Create metrics from your logs with log metricization rules 🔗
Only customers with a Splunk Log Observer entitlement in Splunk Observability Cloud can create log metricization rules. If you do not have a Log Observer entitlement and are using Splunk Log Observer Connect instead, see Introduction to Splunk Log Observer Connect to learn what you can do with the Splunk Enterprise integration..
Log metricization rules allow you to create a log-derived metric that shows aggregate counts. While Log Observer visual analysis allows you to dynamically view aggregate metrics in the context of your query, log metricization rules allow you to embed metrics from log data in charts, dashboards, and detectors. Like any other metric, a metric derived from log metricization rules counts toward your metrics quota per your contract.
There are two ways to create log metricization rules:
Create a log metricization rule from the logs pipeline 🔗
To create a new log metricization rule from scratch in the logs pipeline, follow these steps:
From the navigation menu, go to Organization Settings > Logs Pipeline Management.
Click New Metricization Rule.
Define a matching condition. Only matching logs will be included in the chart resulting from your metricization rule.
To configure a metric, perform a Log Observer aggregation query. Select a function, an aggregate, and a dimension for this query. You can choose from the following functions: Count, AVG, MAX, MIN, and SUM. The default function is Count. The default aggregate is All(*), and the default dimension is severity. See Group logs by fields using log aggregation for a thorough explanation of Log Observer aggregation queries.
Next, select a target field by which you want to aggregate logs. For example, you can choose services as your target field, then group logs by status. Fields with “#”, such as amount, require a numerical value to aggregate logs.
Review your MTS (Metric Time Series) summary to see how your metricization will impact billing. You can optionally select an ingest token to limit the MTS count.
Give your metric a name. The name defaults to the function and target fields.
You can optionally change the Metric Type to Gauge, Counter, or Cumulative counter.
Give your rule a name and description.
Review your configuration, then click Save. Your rule appears in the list of Metricization Rules on the Logs Pipeline Management page. Click the name of your rule to view a summary of the rule. To view the output of your rule, click view your new metric in a chart. This takes you to chart builder populated with your new metric. In less than 60 seconds, you will see metrics reported within the chart.
While still in chart builder, click Save As to save your new metric as a chart. You can then embed it on a new or existing dashboard.
Create a log metricization rule in the context of a Log Observer query 🔗
Often, you might notice the potential value of an existing query and decide to create a log metricization rule based on that query. You can quickly launch the creation of a new metricization rule from a Log Observer query.
To create a new log metricization rule in the context of an existing search query, follow these steps:
In the navigation menu, go to Log Observer.
Create a query that aggregates logs. See Group logs by fields using log aggregation to learn how.
In the upper right corner, click the three-dot More menu and select Save as Metric. This takes you to the Configure Metric page in Logs Pipeline Management.
Go to step 3 in Create a log metricization rule from the logs pipeline and complete the instructions.