> ## 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.

# Preview aggregation rule impact

> Use the Shaping Impact Preview to preview the impact of aggregation rules on your system before applying them.

Shaping Impact Preview lets you create
[rollup](https://docs-xcor.paloaltonetworks.com/control/shaping/shape-metrics/rules/rollup.md) or
[mapping](https://docs-xcor.paloaltonetworks.com/control/shaping/shape-metrics/rules/mapping.md) aggregation rules in preview
mode. A preview rule doesn't change your incoming data or stored time series, but
Palo Alto Networks Cortex XCOR records the shaping impact the rule would have if it
were enabled. Use preview mode to confirm that a rule works as expected and to catch
breaking changes before the rule affects your data.

## Preview a rule's shaping impact

Preview rules appear on the
[Aggregation Rules page](https://docs-xcor.paloaltonetworks.com/control/shaping/shape-metrics/reduce-cardinality/aggregation-rules.md)
alongside rules already in use. On the **Rollup rules** tab, the **Status** column
shows **Preview** for rules in preview mode. To list only preview rules, select
**Preview** in the **Status** menu.

The **Rollup rules** tab displays the
[shaping impact](https://docs-xcor.paloaltonetworks.com/control/shaping/shape-metrics/reduce-cardinality/aggregation-rules.md#shaping-impact)
of each preview rule in the **Matched writes**, **Persisted impact**, and
**Efficiency** columns. If your organization uses consumption-based pricing, the
**Persisted impact** column doesn't appear.

Shaping impact values for a new preview rule can take a few minutes to appear. Until
then, the **Matched writes** and **Efficiency** columns show zero, and the
**Persisted impact** column shows `-`. Reload the page to display updated values.

Preview rules show a **Utility score** of zero, because Cortex XCOR doesn't store
the output metric until the rule is enabled.

The Aggregation Rules page doesn't display shaping impact data for mapping rules. To
view the mode of a mapping rule, open the rule's details drawer from the
**Mapping rules** tab.

## Create a preview rule

To create a preview rollup or mapping rule, set the `mode` field in the rule
definition. The `mode` field accepts these values:

* `PREVIEW`: The rule is in preview mode, and doesn't affect data being mapped,
  rolled up, or added to storage.
* `ENABLED`: The rule is active and affects incoming data.

If `mode` isn't present, the rule defaults to `ENABLED`.

To generate a preview definition for a rollup rule on the Aggregation Rules page,
open the **Create Aggregation Rule** drawer, select **Rule preview** under
**Status**, and then copy the definition from the **Code config** tab.

For mapping or rollup rules created with [Chronoctl](https://docs-xcor.paloaltonetworks.com/tooling/chronoctl), define
`mode` in the `spec` section of the rule definition file:

```yaml theme={null}
spec:
  mode: PREVIEW
```

For mapping or rollup rules created with the
[Terraform provider](https://docs-xcor.paloaltonetworks.com/tooling/infrastructure/terraform), add `mode` to the resource:

```terraform theme={null}
# The operational mode for this rule.
mode = "PREVIEW"
```

## Change a rule from preview to enabled

Preview rules use the same definition files as active rules. To change a rule from
preview to enabled:

1. In the definition file, change the value of `mode` from `PREVIEW` to `ENABLED`.
2. Save the file.
3. Apply the updated definition.

The rule begins affecting data, and the **Status** column on the Aggregation Rules
page shows **Enabled**.


## Related topics

- [Review aggregation rules](https://docs-xcor.paloaltonetworks.com/control/shaping/shape-metrics/reduce-cardinality/aggregation-rules.md)
- [Review shaping rules impact](https://docs-xcor.paloaltonetworks.com/control/shaping/review-impact.md)
- [Drop rules](https://docs-xcor.paloaltonetworks.com/control/shaping/shape-metrics/rules/drop-rules.md)
- [Rollup rules](https://docs-xcor.paloaltonetworks.com/control/shaping/shape-metrics/rules/rollup.md)
- [CreateMappingRule](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/CreateMappingRule.md)


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