> ## Documentation Index
> Fetch the complete documentation index at: https://docs-xcor.paloaltonetworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyze logs usage

> Learn about utility scores and analyzing volume for log data in Cortex XCOR.

Palo Alto Networks Cortex XCOR provides usage data and utility scores for your
log data. Usage analysis gives you insight into *patterns*, which are frequent
combinations of specific `service` and `message` fields in your log data. The
**Logs Usage** page displays the volume of data each pattern consumes, and where and
how often each pattern gets queried. The more a pattern is queried, included in
assets like dashboards, and referenced by unique users, the higher its utility score.

Utility scores are relative, and aren't mapped to any scale. For example, a utility
score of 18 is more than twice that of a utility score of 8, but isn't scored against
a maximum. Lower utility scores indicate patterns that are candidates for reducing,
augmenting, or routing log data to lower costs.

## View log patterns

View log patterns in the **Logs Usage** page to analyze which patterns have greater
utility, and those patterns you can potentially eliminate.

To view log patterns:

1. In the navigation menu, click ** Go to admin view**
   and then select
   ** Optimization > Logs Usage**.

   The **Logs Usage** page displays all patterns found in your log data.

2. Click any pattern to view more detailed information, such as the number of queries
   that reference the pattern across [Logs Explorer](https://docs-xcor.paloaltonetworks.com/investigate/querying/query-logs)
   and in [dashboards](https://docs-xcor.paloaltonetworks.com/investigate/querying/dashboard-query.md).

   In the **Pattern Details** drawer, expand the **Executions** column to see which
   users have executed a query containing this pattern.

3. To view the underlying query for the pattern in Logs Explorer, hold the pointer
   over any pattern, and then click **View in Logs Explorer**.

## Create optimization rules

When viewing a log pattern in Cortex XCOR, you can create a log
[optimization rule](https://docs-xcor.paloaltonetworks.com/control/shaping/shape-logs/control-logs.md) for the selected
pattern. This capability lets you manage log data by transforming, reshaping,
retaining, or excluding data before it's stored.

To create optimization rules:

1. In the navigation menu, click ** Go to admin view**
   and then select
   ** Optimization > Logs Usage**.

   The **Logs Usage** page displays all patterns found in your log data.

2. Click a pattern from the list, or use the
   [query syntax](https://docs-xcor.paloaltonetworks.com/investigate/querying/query-logs/query-syntax.md) to filter on
   attributes in your data, such as a particular environment or cluster name.

   Cortex XCOR returns patterns that include at least one log matched by
   the filter.

3. Press `Ctrl+Enter` (`Command+Return` on macOS) to submit the filter.

4. Click the pattern to open the **Pattern Details** drawer.

5. In the **Pattern Details** drawer, click **Create optimization rule for this pattern**.

   The **Create optimization rule** page opens with the filter for the log pattern.

   > [!NOTE]
   >
   > This rule applies to logs that match only this filter at the time the log
   > data was ingested.

6. Review the returned data from the preview filter, and make changes as necessary.

7. Enter additional information for the specified action. See
   [Create optimization rules](https://docs-xcor.paloaltonetworks.com/control/shaping/shape-logs/control-logs.md#create-optimization-rules)
   for information about each of the required fields.

8. Click **Done** to save the optimization rule definition.

9. In the **Code config** tab,
   [use the Code config tool](https://docs-xcor.paloaltonetworks.com/tooling/gitops.md#use-the-code-config-tool) to apply
   the definition.


## Related topics

- [Analyze metrics usage](https://docs-xcor.paloaltonetworks.com/investigate/analyze/usage.md)
- [Analyze data](https://docs-xcor.paloaltonetworks.com/investigate/analyze.md)
- [Cortex XCOR concepts](https://docs-xcor.paloaltonetworks.com/overview/concepts.md)
- [Analyze consumption](https://docs-xcor.paloaltonetworks.com/control/consumption/analyze.md)
- [Optimize your telemetry data](https://docs-xcor.paloaltonetworks.com/control.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.