Log query
When creating a Widget for logs data, in the Graph your data section, create your data query by selecting Add a query. Each query will be represented by a line, bar, stacked area, pie, number, table, or a log search interface on the chart. The components that make up a query for log data include:
![](https://docs.vngcloud.vn/~gitbook/image?url=https%3A%2F%2F1985221522-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7rE7M1L7GYcwQzNGd0aB%252Fuploads%252Fgit-blob-8501e7f5134a62221fb94b8ac07269a8df078d2b%252Fimage.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=ff3a4155&sv=1)
Including:
1. Hide/ Unhide query
Query result indicator is toggled on/off on the chart. To hide or show the query results, simply click on this icon. When the icon is green (like 'a' in the image), the query results are displayed on the chart. When the icon is gray, the query results are not shown on the chart.
2. Color
Color: choose a color for the chart drawn from the query results.
3. Loại query
Query Type: data type selection box. To plot a chart for logs, you need to select Log here.
4. Log project
Log project: Select a log project by searching and choosing from the list of log projects. You can view this list in the Log/Log project section. For detailed information, refer to Working with Log Project.
5. Search log
Search log: This is where you can perform data log searches based on your desired conditions. For more details on how to search logs, please refer to Log search.
6. Alias
Alias: A memorable, easy-to-understand name for the widget. Our system will automatically create an Alias for your chart, but if you want to create your own Alias, please edit this field.
7. Statistics
Statistics: methods for summarizing data. There are 7 aggregation methods you can use to combine your log data within each time group: count, count unique, sum, avg, min, max, percentiles, described in the table below:
Operations | Meaning |
count | Count the number of generated log records. |
count unique | Count the number of unique log records generated based on the selected field. |
sum | Sum of numerical values from a selected field in the generated logs. |
min | Find the minimum value in the numerical fields of a selected field from the generated logs. |
max | The highest value among the numerical values of a selected field generated in the logs. |
percentiles | Calculate the percentile for a numerical value of a selected field from the generated logs. |
8. Statistics field
Field: select the information field on which you want to perform the operation. For the Count operation, you don't need to select any field. For other operations, you must select a field with a Number data type available in the log project to perform the operation on its value.
9. Group by
Group by: you can group data according to the information fields available in the log project.
10. Interval
Interval: an attribute that allows you to determine the time period for which the widget will display values (data granularity). You can select values like Second, Minute, Day, etc., from the preset values we provide, or you can directly input the desired Interval value.
You can add multiple queries to a chart, we support creating up to 10 queries for a single chart. If you have more than 2 queries in one chart, ensure each query is assigned a distinct color and the data intervals between queries are not too disparate. This will help make your chart more vibrant.
Last updated