This topic describes the LiveTail feature of Log Service. This topic also describes the operations that you can perform after you enable the feature.

Prerequisites

Logs are collected by using Logtail. For more information, see Use Logtail to collect logs.
Important If you use a Logtail plug-in to process text logs or collect the stdout and stderr of a container, you must add the aggregators configuration to the Logtail plug-in configuration. For more information, see Configuration description.

Background information

In online O&M scenarios, you may need to monitor logs in a queue in real time and extract critical information from the latest logs for troubleshooting. If you use a traditional O&M method, you must run the tail -f command on your server to query logs in log files. If you want to narrow the scope of the command output, you must run the grep or grep -v command to filter logs by keyword. To relieve the O&M workloads, Log Service provides the LiveTail feature in the Log Service console. You can use the feature to monitor and analyze logs in real time.

Benefits

  • You can monitor logs in real time and filter logs by keyword.
  • You can configure indexes for collected logs based on collection configurations.
  • You can use delimiters to slit log fields into words. This way, you can query contextual logs that contain the words.
  • You can locate a log file by log and monitor the log logs in real time without the need to log on to a server.

Procedure

Important LiveTail supports only the logs that are collected by Logtail.
  1. Log on to the Log Service console.
  2. In the Projects section, click the project that you want to view.
  3. Choose Log Storage > Logstores. On the Logstores tab, click the Logstore that you want to view.
  4. On the Raw Logs > Raw Data tab, find the log that you want to manage, and click the LiveTail icon.
    LiveTail
  5. In the LiveTail section, view the results.
    After LiveTail is enabled, logs collected by Logtail are displayed in the LiveTail section in real time. By default, the latest log is displayed at the lower part of the LiveTail section, and the scroll bar is also displayed at the lower part. Up to 1,000 logs can be displayed in the LiveTail section. If more than 1,000 logs are collected, the LiveTail section is automatically refreshed to show the latest 1,000 logs. LiveTail statistics

What to do next

OperationDescription
Highlight stringsYou can enter one or more strings in the Highlight field. After the configuration is complete, the specified strings are highlighted in the LiveTail section.
Filter logs by stringYou can enter one or more strings in the Filter By field. After the configuration is complete, only the logs that contain the specified strings are displayed in the LiveTail section.
Filter logs by fieldYou can select one or more fields from the Filter by Field drop-down list. After the configuration is complete, the logs that contain the specified fields are not displayed in the LiveTail section.
Disable LiveTailYou can click Stop to disable LiveTail. After you disable LiveTail, logs in the LiveTail section are no longer updated. You can analyze and troubleshoot the errors that are found when you monitor logs.