After you enable the indexing feature and configure indexes for a Logstore, you can query and analyze the logs that are stored in the Logstore in real time.
Prerequisites
- Logs are collected and stored in a Logstore. For more information, see Data collection overview.
Important If you want to analyze logs, you must store the logs in a Standard Logstore. For more information, see Manage a Logstore.
- The indexing feature is enabled and indexes are configured. For more information, see Configure indexes.
Procedure
Manage query and analysis results
You can view the query and analysis results in a log distribution histogram, on the
Raw Logs tab, or by using a chart. You can also configure alerts and saved searches.
Note By default, only 100 rows of data are returned after you execute a query statement.
You can use a LIMIT clause to change the number of returned rows. For more information,
see LIMIT clause.
- Log distribution histogram
The log distribution histogram displays the distribution of query and analysis results in different time ranges.
- If you move the pointer over a green rectangle, you can view the time range that is represented by the rectangle and the number of logs that are obtained within the time range.
- If you click the green rectangle, you can view a more fine-grained log distribution. You can also view the query and analysis results on the Raw Logs tab.
- Raw Logs tab
On the Raw Logs tab, you can view the logs that match your search conditions. You can click Table or Raw Data to view the logs and perform the following operations:
- Quick analysis: You can use this feature to analyze the distribution of a specific
field within a specific period of time. For more information, see Quick analysis.
You can click the
icon to specify whether to show the names or aliases of fields. You can specify aliases when you configure indexes. For example, if you set the alias of the host_name field to host, host is displayed in the Quick Analysis list after you select Show Field Aliases.
Note If you do not specify an alias for a field, the field name is displayed after you select Show Field Aliases. - Contextual query: On the Raw Data tab, you can find a log and click the
icon to view the context of the log in the raw log file. For more information, see Context query.
Note The contextual query feature supports only the log data that is collected by Logtail. - LiveTail: On the Raw Data tab, you can find a log and click the
icon to monitor logs in real time and extract important information from the logs. For more information, see LiveTail.
Note LiveTail can monitor and extract only the log data that is collected by Logtail. - Tag configurations: On the Raw Data tab, you can click the
icon and select Tag Configurations to hide fields that are less important.
- Column settings: On the Table tab, you can click the
icon and select Column Settings to specify the columns that you want to display in the table. The column names are field names, and the column content is used as field values.
- JSON configurations: On the Table or Raw Data tab, you can click the
icon and select JSON Configurations to specify the level for JSON expansion.
- Event settings: On the Table or Raw Data tab, you can click the
icon and select Event Settings to configure events for raw logs. For more information, see Configure events.
- Log download: On the Table or Raw Data tab, you can click the
icon to download logs. You can specify the method that is used to download logs and the range of logs to download. For more information, see Download logs.
- Quick analysis: You can use this feature to analyze the distribution of a specific
field within a specific period of time. For more information, see Quick analysis.
- Graph tab
After you execute a query statement, you can view the query and analysis results on the Graph tab.
- View query and analysis results: Log Service renders the results of query statements into charts. Log Service provides multiple chart types, such as tables, line charts, and bar charts. Log Service provides the following versions of charts: Pro and Standard. For more information, see Overview of charts (Pro) and Chart overview.
- Log Service allows you to create dashboards to perform real-time data analysis. You can click Add to New Dashboard to save query and analysis results as charts to a dashboard. For more information, see Overview of visualization.
- Configure interaction occurrences: Interaction occurrences are important for data analysis. You can use interaction occurrences to switch between the levels of data dimensions and the analysis granularities to obtain more detailed information. For more information, see Drill-down events.
- LogReduce tab
On the LogReduce tab, you can click Enable LogReduce to cluster similar logs. For more information, see LogReduce.
- Alerts
On the Search & Analysis page, you can choose Configure an alert monitoring rule in Log Service.
to configure an alert rule based on the query and analysis results. For more information, see - Saved searches
On the Search & Analysis page, you can click Save Search to save a query statement as a saved search. For more information, see Saved search.