You can perform real-time log query and analysis in the TLS console using query and analysis statements. Prerequisites: log data is collected; indexes are configured; and the statistics feature for fields is enabled. This topic describes how to analyze logs.
Notice
- The log storage period of log project determines data storage period in TLS. Logs that have expired and been deleted can not be queried or analyzed.
- Only log data that is collected after enabling the statistical function can be involved in statistical analysis.
Prerequisites
- The log project and log topic are created.
- Log data is collected via LogCollector or other methods.
- The index is properly configured, and statistical functions are enabled for the fields involved in the analysis. For more details, see Configuration Index.
Steps
- Select the region where log service is located from the top navigation bar.
- In the left navigation pane, select Common functions > Query and analysis.
- On Query and analysis page and in the list of left pane, select the specified project and topic.
- Enter your query and analysis statement.
&{Query statement} | &{SQLAnalysis statement}
- The query and analysis statement consists of a query statement and a SQL analysis statement. Data statistics and analysis are performed on results that meet the query conditions.
- Support using the intelligent assistant to help generate query and analysis statements. For details, see Smart assistant copilot.
- The query statement and analysis statement are separated by an English vertical bar (|).
- Setting the query statement to a space or asterisk (*) queries all data.
- Set the query and analysis conditions, and then click Search.
- View analysis results on the Chart analysis tab.
- By default, the page displays query analysis results in table form. You can also select other chart types and add corresponding chart settings. For more details, see View analysis charts.
- The Query results section shows basic information of the current log analysis, including the total number of logs and whether the query results are precise. For more details, see View analysis data.
View analysis results
Tip
In addition to the following analysis results, TLS also provides a histogram and raw log query results, displaying details of logs that meet the query criteria. For more details, see View query results. Use AI to interpret analysis results
TLS provides AI interpretation. After you obtain the search results, click Log interpretation assistant and enter your interpretation requirements. The system will retrieve log topic information on the current page, including topic descriptions, index configuration, query and analysis statements, etc. What's more, the AI assistant provides different summaries based on the original logs and chart analysis to help you quickly understand overall log data.
Example: Click Log interpretation assistant, then enter and send Analyze the key points in the current raw logs.
View analysis data
The Query results section displays basic information of this query and analysis operation, such as the total number of logs and result rows, to help you understand its overall status.
View analysis charts
The page displays query and analysis results in table format by default. You can also choose the chart type that suits your needs based on the SQL analysis statement and objectives to assist with data analysis. Currently, TLS supports various types of analysis charts, including tables, bar charts, line charts, and more. For details, see Overview of query and analysis charts. Download logs
In the upper right corner of the Raw log or Chart analysis tab, click Download log, and then you can download raw log data or query and analysis results to your device for data review or further analysis. For more details, see Download logs. Save to dashboard
TLS allows you to quickly save chart-based query and analysis results to your dashboard. You can add them to an existing dashboard or save them as a new dashboard. Via dashboard, you can quickly review real-time query and analysis results across different log topics and queries. This allows you to monitor key metric statuses and trends in log data and build a data analysis overview for operations or maintenance scenarios. For more details, see Add charts to dashboard. TLS supports scheduled SQL analysis. You can query and analyze log data within a specified range based on predefined time windows and scheduling cycles. The results are saved to a designated log topic. Click Save as Scheduled SQL to create a scheduled SQL analysis task. For details, see Create a timed SQL analysis task.