Skip to content

Query API Description

The Query API is an API that allows you to retrieve state and alarm/event data from Bühler Insights. It is based on the Kusto Query Language and can retrieve data in raw format or aggregate it on the fly.

Note

Although the Query API can be used to retrieve raw data, it is recommended to downsample the data to the finest granularity possible. For continuous export of raw data, please use the Data Export Engine.

States Table

The states table contains information about the state of data points from devices within the system. Each row in the table represents a single state of a data point, and includes information such as the device ID, the agent ID, the timestamp of the state, and the value of the state. The table also includes columns for the plant ID, the name ID, the name of the data point, and any associated data metadata.

ColumnName ColumnOrdinal DataType ColumnType Description Example
Uid 0 System.String string Unique identifier of the device 963e86fc-eed2-4236-bcd4-b5b251d0a54a_qms-milb_flour1
DeviceId 1 System.String string Identifier for the device given by the source of the data QMS-MILB_Flour1
AgentId 2 System.String string Identifier for the agent 963e86fa-eed2-4236-bcd4-b5b251d0a54a
AgentTimestamp 3 System.DateTime datetime Timestamp when processed by the agent 2022-01-01T00:00:00Z
IngestionId 4 System.String string Identifier for the ingestion Telemetry
IngestionTimestamp 5 System.DateTime datetime Timestamp of the ingestion 2022-01-01T00:00:00Z
MessageId 6 System.String string Identifier for the message message-001
MessageType 7 System.String string Type of the message state
MessageVersion 8 System.String string Version of the message 1.0
MessageMetadata 9 System.Object dynamic Metadata associated with the message {"recipe": "1123333" ..}
PlantId 10 System.String string Identifier for the plant 1123333
NameId 11 System.String string Unique and opaque identifier for the data point name eb786a6eab0ec0cd2e3a23930fcaac3bd0aa26167079b4bac431bcd95ce1c75d
Name 12 System.String string Name of the data point temperature
DataMetadata 13 System.Object dynamic Metadata associated with the data {"jobIdent": "Job1"}
Unit 15 System.String string Unit of the data point rpm
Value 16 System.Object dynamic Value of the data point 25.0
DeviceTimestamp 17 System.DateTime datetime Timestamp of the device 2022-01-01T00:00:00Z
Timestamp 18 System.DateTime datetime Timestamp which is a fallback of device -> agent -> ingestion timestamp 2022-01-01T00:00:00Z
Source 19 System.String string Source of the data point Edge
LocalAgentTimestamp 20 System.DateTime datetime Local timestamp of the agent 2022-01-01T00:00:00-05:00
LocalIngestionTimestamp 21 System.DateTime datetime Local timestamp of the ingestion 2022-01-01T00:00:00-05:00
LocalDeviceTimestamp 22 System.DateTime datetime Local timestamp of the device 2022-01-01T00:00:00-05:00
LocalTimestamp 23 System.DateTime datetime Local timestamp which is a fallback of device -> agent -> ingestion timestamp 2022-01-01T00:00:00-05:00

Events Table

The events table contains information about events that have occurred within the system. Each row in the table represents a single event, and includes information such as the device ID, the agent ID, the timestamp of the event, and the severity of the event. The table also includes columns for the state of the event, whether it has been acknowledged, and any associated alarm ID or reason.

ColumnName ColumnOrdinal DataType ColumnType Description Example
Uid 0 System.String string Unique identifier of the device 963e86fc-eed2-4236-bcd4-b5b251d0a54a_nos_0011790040_00001_pcs
DeviceId 1 System.String string Identifier for the device given by the source of the data nos_0011790040_00001_pcs
AgentId 2 System.String string Identifier for the agent 963e86fc-eed2-4236-bcd4-c3b251d0a54a
AgentTimestamp 3 System.DateTime datetime Timestamp of the agent 2022-01-01T00:00:00Z
IngestionId 4 System.String string Identifier for the ingestion Telemetry
IngestionTimestamp 5 System.DateTime datetime Timestamp of the ingestion 2022-01-01T00:00:00Z
MessageId 6 System.String string Identifier for the message 863b68ba-6247-44eb-b6a5-a54699da410c
MessageType 7 System.String string Type of the message state
MessageVersion 8 System.String string Version of the message 1.0
MessageMetadata 9 System.Object dynamic Metadata associated with the message {"recipe": "1123333" ..}
PlantId 10 System.String string Identifier for the plant 1123333
NameId 11 System.String string Identifier for the name 626ad8b8a910125da3e82283f0b362967c0fc97783dfde1be3d152ce265ff92b
Name 12 System.String string Name of the data point temperature
DataMetadata 13 System.Object dynamic Metadata associated with the data {"jobIdent": "Job1"}
Unit 15 System.String string Unit of the data point rpm
Value 16 System.Object dynamic Value of the data point 25.0
DeviceTimestamp 17 System.DateTime datetime Timestamp of the device 2022-01-01T00:00:00Z
Timestamp 18 System.DateTime datetime Timestamp which is a fallback of device -> agent -> ingestion timestamp 2022-01-01T00:00:00Z
Source 19 System.String string Source of the data point Edge
LocalAgentTimestamp 20 System.DateTime datetime Local timestamp of the agent 2022-01-01T00:00:00-05:00
LocalIngestionTimestamp 21 System.DateTime datetime Local timestamp of the ingestion 2022-01-01T00:00:00-05:00
LocalDeviceTimestamp 22 System.DateTime datetime Local timestamp of the device 2022-01-01T00:00:00-05:00
LocalTimestamp 23 System.DateTime datetime Local timestamp which is a fallback of device -> agent -> ingestion timestamp 2022-01-01T00:00:00-05:00