Viewing CCE Application Logs on Charts
You can use SQL statements to search for and analyze logs ingested to LTS, and generate charts to display log data and monitor trends.
This section uses the CCE application logs ingested as an example to describe how the LTS displays CCE application logs on charts.
Prerequisites
- CCE application logs have been collected. For details, see Ingesting CCE Application Logs to LTS.
- Log structuring has been configured. For details, see Log Structuring.
- Logs have been indexed. For details, see Configuring Log Indexing.
Restrictions
Up to 100 charts can be created for a log stream.
Search and Analysis
- Log in to the LTS console. In the navigation pane, choose Log Management.
- In the log group list, click
on the left of a group, and click the desired log stream to go to its details page. - Click the Charts tab. On the tab page displayed, select a time range, enter SQL statements for log search and analysis in the SQL search box, and click Searching and Analyzing Logs.
Example: Collect the number of logs containing first_timestamp, sort the logs in descending order by number, and return the first 100 records.
* | select `first_timestamp`, count(*) as log_count from log group by `first_timestamp` order by log_count desc limit 100
- If more than 1 billion logs are generated within the specified time range, iterative query is triggered so you can view all logs in multiple queries. The message Query status: Results are accurate is displayed.
- You can select various charts to display the query result.
- For details about SQL queries, see SQL Functions.
Figure 1 Searching and analyzing logs
Creating a Chart
- Select a chart type and click Create or Save to save the current query result as a chart. The following uses a table and bar chart respectively as examples to show charts.
- Table
If you select Table, you can set a layout, such as Standard, Query/Analysis, Table, and Column as required. For details about the parameters, see Table.
Figure 2 Table
- Bar chart
If you select Bar Chart, you can set a layout, such as Standard, Bar Chart, Query/Analysis, and Legend as required. For details about the parameters, see Bar Chart.
Figure 3 Bar chart
- Table
- Click Create. On the page that is displayed, enter Chart Name and SQL Statement. Figure 4 Creating a chart
- Click OK.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
