Type to search.

Run a pattern analysis on your log data in Discover

Serverless

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

If your logs are free-form messages, pattern analysis groups similar messages into patterns, so you can see which ones are common, filter out the noise, and focus on unusual messages while you troubleshoot. For each pattern, Discover shows how its messages are distributed over time in a chart, and gives example documents.

  • Make sure Discover is in classic mode. ES|QL mode doesn't support this functionality. To switch, refer to Switch to Discover's classic mode.
  • You need a Platinum or Enterprise subscription or an active trial for Elastic Stack. Pattern analysis relies on a feature that requires it.
  • Discover must have a data view selected that has a time field and contains a text field, and a time range that contains data.
  • This example uses the web logs sample data. To follow along, add it and select its data view, or use your own log data.
Tip Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability Preview This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Preview since 9.4 This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

In ES|QL mode, you can group similar messages in a query.

  1. Go to Discover.

  2. Expand the data view menu, and select Kibana Sample Data Logs.

  3. If you don't see any results, expand the time range, for example, to Last 7 days.

  4. Select Patterns (or View as → Patterns, depending on your version). Discover groups the messages of a text field into patterns and lists them with the chart.

    Patterns view in Discover listing the patterns found in the log messages, with the View as menu open
    Patterns view in Discover listing the patterns found in the log messages, with the View as menu open
  5. Optional: To analyze a different text field, change the field in the field selector.

  6. Optional: To calculate patterns over a longer period than the time range you set in step 3, select the Options button to open the Pattern analysis settings, and set the Minimum time range. A longer range improves accuracy. The list still shows the patterns for the time range you set in step 3.

  7. Optional: To focus on specific messages, select one or more patterns, and then select Filter for patterns in Discover. To hide the messages that match them instead, select Filter out patterns in Discover.

Result: Discover shows the patterns in your log messages. After you filter, the table shows only the documents that match the patterns you kept, or only the ones that don't match the patterns you filtered out.

To find unusual behavior in a pattern, create a categorization anomaly detection job from the Patterns view. This needs permission to create anomaly detection jobs, and Discover doesn't show the button without it.