LogReduce

When you are flooded with mountains of log data, it is not easy to quickly understand what have happened to the system in a certain time range or figure out whether applications are healthy. Detecting unusual occurrences by searching for keywords is also challenging. This is when LogReduce comes in handy. LogReduce clusters logs with similar structures into groups and extract log patterns for each group. In this way, the number of logs that need to be investigated is reduced, enabling you to get a quick overview of the application status and identify exceptions right away. Let's assume that there are four log events.

User A logged in
User B logged in
User C logged out
User D logged out

With LogReduce, the log events are aggregated into two groups and two patterns are extracted. In each pattern, the snippets that vary between log events are represented by =*, as shown in the following:

User =* logged in
User =* logged out

This section describes how to enable LogReduce, view log patterns, and adjust the pattern granularity.

LogReduce is available only in CN North-Beijing4.

Billing

LogReduce is available for free during the open beta test.

Enabling LogReduce

  1. Log in to the LTS console and choose Log Management.
  2. In the log group list, click the name of a log group.
  3. In the log stream list, click the name of a log stream.
  4. Choose the LogReduce tab and click Enable LogReduce.

Viewing Log Patterns

For multi-line log events or long log events, only the first 20 words in the log events that are parsed by delimiters (=,:;|{}()[]\t\f) are retained in log patterns.

  1. On the LogReduce tab, select a time range to view log patterns.

    • Total Log Patterns: total number of extracted log patterns.
    • Total Log Events: total number of raw log events in the selected time range after LogReduce is enabled.
    • Log Pattern: Similar log events are aggregated into log patterns. In a log pattern, =* is used to represent the snippets that vary among log events, for example, User =* logged =*.
    • Log Events: number of raw log events in each log pattern in the selected time range.
  2. Click a log pattern to view the following details in the sliding window on the right.

    • Log Events: number of raw log events in the log pattern in the selected time range.
    • Collected: time when a log event was collected.
    • Content: content of a log event. Click View Context next to a log event to view its context.
    • You can check the parameters of the log event by clicking .
  3. There are two kinds of log patterns: compound ones (with displayed before the patterns), and atomic ones (with no displayed before the patterns). Compound patterns are calculated based on atomic patterns. You can click to display child patterns of a compound pattern.

Adjusting the Pattern Granularity

You can change the pattern granularity to adjust the level of log aggregation. When you increase the pattern granularity, only logs that share much in common will be grouped. The extracted log patterns will represent a smaller number of log events and each log pattern contains fewer variables (=*). On the contrary, a lower granularity will result in log patterns that contain a wider variety of log events. Let's assume that we have four log events.

User A logged in
User B logged in
User C logged out
User D logged out

When you increase the granularity, two log patterns are extracted:

User =* logged in
User =* logged out

When you decrease the granularity, only one pattern is extracted:

User =* logged =*

To adjust the pattern granularity, do as follows:

  1. Access the LogReduce tab, and select a time range.
  2. Drag the slider to adjust the log pattern granularity.
    Figure 1 Higher granularity resulting in more log patterns
    Figure 2 Lower granularity resulting in fewer log patterns

Disabling LogReduce

LogReduce becomes unavailable after being disabled. When you enable this function again, log events generated during the disabling period will not be counted in the total number of log events.

  1. On the LogReduce tab, click Disable LogReduce in the upper right corner.
  2. Click Yes.