Contents
"Events" widget
You can use the Events widget to get analytics based on SQL queries.
When creating this type of widget, you must set values for the following settings:
The tab:
- Graph is the type of the graph. The following graph types are available:
- Pie chart.
- Bar chart.
- Counter.
- Line chart.
- Table.
- Date Histogram.
- Tenant is the tenant for which data is displayed in the widget.
You can select multiple tenants.
By default, data is displayed for tenants that have been selected in layout settings.
- Period is the period for which data is displayed in the widget. The following periods are available:
- As layout means data is displayed for the period selected for the layout.
This is the default setting.
- 1 hour—data is displayed for the previous hour.
- 1 day—data is displayed for the previous day.
- 7 days—data is displayed for the previous 7 days.
- 30 days—data is displayed for the previous 30 days.
- In period—data is displayed for a custom time period.
If you select this option, use the opened calendar to select the start and end dates of the period and click Apply Filter. The date and time format depends on your operating system's settings. You can also manually change the date values if necessary.
The upper boundary of the period is not included in the time slice defined by it. In other words, to receive analytics for a 24-hour period, you should configure the period as Day 1, 00:00:00 – Day 2, 00:00:00 instead of Day 1, 00:00:00 – Day 1, 23:59:59.
- As layout means data is displayed for the period selected for the layout.
- Show data for previous period—enable the display of data for two periods at the same time: for the current period and for the previous period.
- Storage is the storage that is searched for events.
- The SQL query field (
) lets you manually enter a query for filtering and searching events.
You can also create a query in Builder by clicking
.
How to create a query in Builder
Example of search conditions in the query builder
The "metric" and "value" aliases in SQL queries cannot be edited for any type of event analytics widget, except tables.
Aliases in widgets of the Table type can contain Latin and Cyrillic characters, as well as spaces. When using spaces or Cyrillic, the alias must be enclosed in quotation marks:
"An alias with a space"
,`Another alias`
.When displaying data for the previous period, sorting by the
count(ID)
parameter may not work correctly. It is recommended to sort by the metric parameter. For example,SELECT count(ID) AS "metric", Name AS "value" FROM `events` GROUP BY Name ORDER BY metric ASC LIMIT 250
.In the Counter type widgets you must specify the method of data processing for the values of the
SELECT
function:count
,max
,min
,avg
,sum
.
The tab:
The tab is displayed if on the tab in the Graph field you have selected one of the following values: Bar chart, Line chart, Date Histogram.
- The Y-min and Y-max values set the scale of the Y axis.
- The X-min and X-max values set the scale of the X axis.
Negative values can be displayed on chart axes. This is due to the scaling of charts on the widget and can be fixed by setting zero as the minimum chart values instead of Auto.
- Line-width is the width of the line on the graph. This field is displayed for the "Line chart" graph type.
- Point size is the size of the pointer on the graph. This field is displayed for the "Line chart" graph type.
The tab:
- Name is the name of the widget.
- Description is the description of the widget.
- Color is a drop-down list where you can select the color for displaying information:
- default for your browser's default font color
- green
- red
- blue
- yellow
- Horizontal makes the histogram horizontal instead of vertical.
When this option is enabled, when a widget displays a large amount of data, horizontal scrolling is not available and all available information is fit into the fixed size of the widget. If there is a lot of data to display, it is recommended to increase the widget size.
- Show total shows sums total of the values.
- Legend displays a legend for analytics.
The toggle switch is turned on by default.
- Show nulls in legend displays parameters with a null value in the legend for analytics.
The toggle switch is turned off by default.
- Decimals—the field to enter the number of decimals to which the displayed value must be rounded off.
- Period segments length (available for graphs of the Date Histogram type) sets the length of segments into which you want to divide the period.
"Active lists" widget
You can use the Active lists widget to get analytics based on SQL queries.
When creating this type of widget, you must set values for the following settings:
The tab:
- Graph is the type of the graph. The following graph types are available:
- Bar chart.
- Pie chart.
- Counter.
- Table.
- Tenant is the tenant for which data is displayed in the widget.
You can select multiple tenants.
By default, data is displayed for tenants that have been selected in layout settings.
- Correlator is the name of the correlator that contains the active list for which you want to receive data.
- Active list is the name of the active list for which you want to receive data.
The same active list can be used by different correlators. However, a separate entity of the active list is created for each correlator. Therefore, the contents of the active lists used by different correlators differ even if the active lists have the same names and IDs.
- The SQL query field lets you manually enter a query for filtering and searching active list data.
The query structure is similar to that used in event search.
When creating a query based on active lists, you must consider the following:
- For the FROM function, you must specify the `records` value.
- If you want to receive data for fields whose names contain spaces and Cyrillic characters, you must also enclose such names in quotes in the query:
- In the SELECT function, enclose aliases in double quotes or backticks: "alias", `another alias`.
- In the ORDER BY function, enclose aliases in backticks: `another alias`.
- Event field values are enclosed in straight quotes: WHERE DeviceProduct = 'Microsoft'.
Names of event fields do not need to be enclosed in quotes.
If the name of an active list field begins or ends with spaces, these spaces are not displayed by the widget. The field name must not contain spaces only.
If the values of the active list fields contain trailing or leading spaces, it is recommended to use the LIKE '%field value%' function to search by them.
- In your query, you can use service fields: _key (the field with the keys of active list records) and _count (the number of times this record has been added to the active list), as well as custom fields.
- The "metric" and "value" aliases in SQL queries cannot be edited for any type of active lists analytics widget, except tables.
- If a date and time conversion function is used in an SQL query (for example, fromUnixTimestamp64Milli) and the field being processed does not contain a date and time, an error will be displayed in the widget. To avoid this, use functions that can handle a null value. Example: SELECT _key, fromUnixTimestamp64Milli(toInt64OrNull(DateTime)) as Date FROM `records` LIMIT 250.
- Large values for the LIMIT function may lead to browser errors.
- If you select Counter as the graph type, you must specify the method of data processing for the values of the SELECT function: count, max, min, avg, sum.
- You can get the names of the tenants in the widget instead of their IDs.
Special considerations apply when using aliases in SQL functions and SELECT, you can use double quotes and backticks: ", `.
If you selected Counter as the graph type, aliases can contain Latin and Cyrillic characters, as well as spaces. When using spaces or Cyrillic, the alias must be enclosed in quotation marks: "An alias with a space", `Another alias`.
When displaying data for the previous period, sorting by the count(ID) parameter may not work correctly. It is recommended to sort by the metric parameter. For example, SELECT count(ID) AS "metric", Name AS "value" FROM `events` GROUP BY Name ORDER BY metric ASC LIMIT 250.
Sample SQL queries for receiving analytics based on active lists:
SELECT * FROM `records` WHERE "Event source" = 'Johannesburg' LIMIT 250
This query returns the key of the active list where the field name is "Event source" and the value of this field is "Johannesburg".
SELECT count(_key) AS metric, Status AS value FROM `records` GROUP BY value ORDER BY metric DESC LIMIT 250
Query for a pie chart, which returns the number of keys in the active list ('count' aggregation over the '_key' field) and all variants of the Status custom field. The widget displays a pie chart with the total number of records in the active list, divided proportionally by the number of possible values for the Status field.
SELECT Name, Status, _count AS Number FROM `records` WHERE Description ILIKE '%ftp%' ORDER BY Name DESC LIMIT 250
Query for a table, which returns the values of the Name and Status custom fields, as well as the service field '_count' for those records of the active list in which the value of the Description custom field matches ILIKE '%ftp%'. The widget displays a table with the Status, Name, and Number columns.
The tab:
This tab is displayed if on the tab, in the Graph field, you have selected Bar chart.
- The Y-min and Y-max values set the scale of the Y axis.
- The X-min and X-max values set the scale of the X axis.
Negative values can be displayed on chart axes. This is due to the scaling of charts on the widget and can be fixed by setting zero as the minimum chart values instead of Auto.
The tab:
- Name is the name of the widget.
- Description is the description of the widget.
- Color is a drop-down list where you can select the color for displaying information:
- default for your browser's default font color
- green
- red
- blue
- yellow
- Horizontal makes the histogram horizontal instead of vertical.
When this setting is enabled, all available information is fitted into the configured widget size. If the amount of data is great, you can increase the size of the widget to display it optimally.
- Show total shows sums total of the values.
- Legend displays a legend for analytics.
The toggle switch is turned on by default.
- Show nulls in legend displays parameters with a null value in the legend for analytics.
The toggle switch is turned off by default.
"Context tables" widget
You can use the Context tables widget to get analytics based on SQL queries.
When creating this type of widget, you must set values for the following settings:
The tab:
- Graph is the type of the graph. The following graph types are available:
- Bar chart.
- Pie chart.
- Counter.
- Table.
- Tenant is the tenant for which data is displayed in the widget.
You can select multiple tenants.
By default, data is displayed for tenants that have been selected in layout settings.
- Correlator is the name of the correlator that contains the context table for which you want to receive information.
- Context table is name of the context table for which you want to receive information.
The same context table can be used in multiple correlators. However, a separate entity of the context table is created for each correlator. Therefore, the contents of the context tables used by different correlators are different even if the context tables have the same name and ID.
- The SQL query field lets you manually enter a query for filtering and searching context table data. By default, for each widget type, the field contains a query that obtains the context table schema and the key by key fields.
The query structure is similar to that used in event search.
When creating a query based on context tables, you must consider the following:
- For the FROM function, you must specify the `records` value.
- You can get data only for the fields specified in the context table schema.
- You can use supported features of ClickHouse.
- If you want to receive data for fields whose names contain spaces and Cyrillic characters, you must also enclose such names in quotes in the query:
- In the SELECT function, enclose aliases in double quotes or backticks: "alias", `another alias`.
- In the ORDER BY function, enclose aliases in backticks: `another alias`.
- Event field values are enclosed in straight quotes: WHERE DeviceProduct = 'Microsoft'.
Names of event fields do not need to be enclosed in quotes.
If the name of an active list field begins or ends with spaces, these spaces are not displayed by the widget. The field name must not contain spaces only.
If the values of the active list fields contain trailing or leading spaces, it is recommended to use the LIKE '%field value%' function to search by them.
- You can use the _count service field (how many times this record has been added to the context table), as well as custom fields.
- The "metric" and "value" aliases in SQL queries cannot be edited for any type of active lists analytics widget, except tables.
- If a date and time conversion function is used in an SQL query (for example, fromUnixTimestamp64Milli) and the field being processed does not contain a date and time, an error will be displayed in the widget. To avoid this, use functions that can handle a null value. Example: SELECT _key, fromUnixTimestamp64Milli(toInt64OrNull(DateTime)) as Date FROM `records` LIMIT 250.
- Large values for the LIMIT function may lead to browser errors.
- If you select Counter as the graph type, you must specify the method of data processing for the values of the SELECT function: count, max, min, avg, sum.
- You can get the names of the tenants in the widget instead of their IDs.
Special considerations when using aliases in SQL functions and SELECT statements: you may use double quotes and backquotes: ",`.
When using spaces or Cyrillic characters, the alias must be enclosed in double quotes: "Alias with a space", values must be enclosed in straight single quotes: 'Value with a space'.
When displaying data for the previous period, sorting by the count(ID) parameter may not work correctly. It is recommended to sort by the metric parameter. For example, SELECT count(ID) AS "metric", Name AS "value" FROM `events` GROUP BY Name ORDER BY metric ASC LIMIT 250.Sample SQL queries for receiving analytics based on active lists:
- SELECT * FROM `records` WHERE "Event source" = 'Johannesburg' LIMIT 250
This query returns the key of the active list where the field name is "Event source" and the value of this field is "Johannesburg".
- SELECT count(_key) AS metric, Status AS value FROM `records` GROUP BY value ORDER BY metric DESC LIMIT 250
Query for a pie chart, which returns the number of keys in the active list ('count' aggregation over the '_key' field) and all variants of the Status custom field. The widget displays a pie chart with the total number of records in the active list, divided proportionally by the number of possible values for the Status field.
- SELECT Name, Status, _count AS Number FROM `records` WHERE Description ILIKE '%ftp%' ORDER BY Name DESC LIMIT 250
Query for a table, which returns the values of the Name and Status custom fields, as well as the service field '_count' for those records of the active list in which the value of the Description custom field matches ILIKE '%ftp%'. The widget displays a table with the Status, Name, and Number columns.
The tab:
This tab is displayed if on the tab, in the Graph field, you have selected Bar chart.
- The Y-min and Y-max values set the scale of the Y axis.
- The X-min and X-max values set the scale of the X axis.
- Negative values can be displayed on chart axes. This is due to the scaling of charts on the widget and can be fixed by setting zero as the minimum chart values instead of Auto.
The tab:
- Name is the name of the widget.
- Description is the description of the widget.
- Color is a drop-down list where you can select the color for displaying information:
- default for your browser's default font color
- green
- red
- blue
- yellow
- Horizontal makes the histogram horizontal instead of vertical.
When this setting is enabled, all available information is fitted into the configured widget size. If the amount of data is great, you can increase the size of the widget to display it optimally.
- Show total shows sums total of the values.
- Legend displays a legend for analytics.
The toggle switch is turned on by default.
- Show nulls in legend displays parameters with a null value in the legend for analytics.
The toggle switch is turned off by default.
Other widgets
This section describes the settings of all widgets except the Events widget and Active lists widget.
The set of parameters available for a widget depends on the type of graph that is displayed on the widget. The following graph types are available in KUMA:
- Pie chart (
).
- Counter (
).
- Table (
).
- Bar chart (
).
- Date Histogram (
).
- Line chart.
Settings for pie charts
- Name is the name of the widget.
- Description is the description of the widget.
- Tenant is the tenant for which data is displayed in the widget.
You can select multiple tenants.
By default, data is displayed for tenants that have been selected in layout settings.
- Period is the period for which data is displayed in the widget. The following periods are available:
- As layout means data is displayed for the period selected for the layout.
This is the default setting.
- 1 hour—data is displayed for the previous hour.
- 1 day—data is displayed for the previous day.
- 7 days—data is displayed for the previous 7 days.
- 30 days—data is displayed for the previous 30 days.
- In period—data is displayed for a custom time period.
If you select this option, use the opened calendar to select the start and end dates of the period and click Apply Filter. The date and time format depends on your operating system's settings. You can also manually change the date values if necessary.
The upper boundary of the period is not included in the time slice defined by it. In other words, to receive analytics for a 24-hour period, you should configure the period as Day 1, 00:00:00 – Day 2, 00:00:00 instead of Day 1, 00:00:00 – Day 1, 23:59:59.
- As layout means data is displayed for the period selected for the layout.
- Show total shows sums total of the values.
- Legend displays a legend for analytics.
The toggle switch is turned on by default.
- Show nulls in legend displays parameters with a null value in the legend for analytics.
The toggle switch is turned off by default.
- Decimals—the field to enter the number of decimals to which the displayed value must be rounded off.
Settings for counters
- Name is the name of the widget.
- Description is the description of the widget.
- Tenant is the tenant for which data is displayed in the widget.
You can select multiple tenants.
By default, data is displayed for tenants that have been selected in layout settings.
- Period is the period for which data is displayed in the widget. The following periods are available:
- As layout means data is displayed for the period selected for the layout.
This is the default setting.
- 1 hour—data is displayed for the previous hour.
- 1 day—data is displayed for the previous day.
- 7 days—data is displayed for the previous 7 days.
- 30 days—data is displayed for the previous 30 days.
- In period—data is displayed for a custom time period.
If you select this option, use the opened calendar to select the start and end dates of the period and click Apply Filter. The date and time format depends on your operating system's settings. You can also manually change the date values if necessary.
The upper boundary of the period is not included in the time slice defined by it. In other words, to receive analytics for a 24-hour period, you should configure the period as Day 1, 00:00:00 – Day 2, 00:00:00 instead of Day 1, 00:00:00 – Day 1, 23:59:59.
- As layout means data is displayed for the period selected for the layout.
Settings for tables
- Name is the name of the widget.
- Description is the description of the widget.
- Tenant is the tenant for which data is displayed in the widget.
You can select multiple tenants.
By default, data is displayed for tenants that have been selected in layout settings.
- Period is the period for which data is displayed in the widget. The following periods are available:
- As layout means data is displayed for the period selected for the layout.
This is the default setting.
- 1 hour—data is displayed for the previous hour.
- 1 day—data is displayed for the previous day.
- 7 days—data is displayed for the previous 7 days.
- 30 days—data is displayed for the previous 30 days.
- In period—data is displayed for a custom time period.
If you select this option, use the opened calendar to select the start and end dates of the period and click Apply Filter. The date and time format depends on your operating system's settings. You can also manually change the date values if necessary.
The upper boundary of the period is not included in the time slice defined by it. In other words, to receive analytics for a 24-hour period, you should configure the period as Day 1, 00:00:00 – Day 2, 00:00:00 instead of Day 1, 00:00:00 – Day 1, 23:59:59.
- As layout means data is displayed for the period selected for the layout.
- Show data for previous period—enable the display of data for two periods at the same time: for the current period and for the previous period.
- Color is a drop-down list where you can select the color for displaying information:
- default for your browser's default font color
- green
- red
- blue
- yellow
- Decimals—the field to enter the number of decimals to which the displayed value must be rounded off.
Settings for Bar charts and Date Histograms
The tab:
- The Y-min and Y-max values set the scale of the Y axis.
- The X-min and X-max values set the scale of the X axis.
Negative values can be displayed on chart axes. This is due to the scaling of charts on the widget and can be fixed by setting zero as the minimum chart values instead of Auto.
- Decimals—the field to enter the number of decimals to which the displayed value must be rounded off.
The tab:
- Name is the name of the widget.
- Description is the description of the widget.
- Tenant is the tenant for which data is displayed in the widget.
You can select multiple tenants.
By default, data is displayed for tenants that have been selected in layout settings.
- Period is the period for which data is displayed in the widget. The following periods are available:
- As layout means data is displayed for the period selected for the layout.
This is the default setting.
- 1 hour—data is displayed for the previous hour.
- 1 day—data is displayed for the previous day.
- 7 days—data is displayed for the previous 7 days.
- 30 days—data is displayed for the previous 30 days.
- In period—data is displayed for a custom time period.
If you select this option, use the opened calendar to select the start and end dates of the period and click Apply Filter. The date and time format depends on your operating system's settings. You can also manually change the date values if necessary.
The upper boundary of the period is not included in the time slice defined by it. In other words, to receive analytics for a 24-hour period, you should configure the period as Day 1, 00:00:00 – Day 2, 00:00:00 instead of Day 1, 00:00:00 – Day 1, 23:59:59.
- As layout means data is displayed for the period selected for the layout.
- Show data for previous period—enable the display of data for two periods at the same time: for the current period and for the previous period.
- Color is a drop-down list where you can select the color for displaying information:
- default for your browser's default font color
- green
- red
- blue
- yellow
- Horizontal makes the histogram horizontal instead of vertical.
When this setting is enabled, all available information is fitted into the configured widget size. If the amount of data is great, you can increase the size of the widget to display it optimally.
- Show total shows sums total of the values.
- Legend displays a legend for analytics.
The toggle switch is turned on by default.
- Show nulls in legend displays parameters with a null value in the legend for analytics.
The toggle switch is turned off by default.
- Period segments length (available for graphs of the Date Histogram type) sets the length of segments into which you want to divide the period.