Skip to main content

Freeze

Flow Control

Synopsis​

Locks one target for the rest of the record. After a freeze, a later reroute to that target sends no copy of the record.

Schema​

- freeze:
target: <string>
destination: <string>
description: <text>
if: <script>
ignore_failure: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>

Configuration​

FieldRequiredDefaultDescription
targetY*-Name of the target to lock. Supports templates
destinationN-Alias for target. When both are set, destination is used
descriptionN-Explanatory note
ifN-Condition to run
ignore_failureNfalseSee Handling Failures
on_failureN-See Handling Failures
on_successN-See Handling Success
tagN-Identifier
disabledNfalseWhen true, the processor is skipped and the event continues to the next one. Lets you take a processor out of the path without removing its configuration

* Set target or destination. A freeze with neither fails with the error freeze needs a target.

Details​

A freeze decides what reaches one target from this point on. It does not change the record.

Later reroutes send nothing. After a freeze, a reroute to the locked target sends no copy of the record. This is true whether the reroute sends the copy at once or stages it with staging: true. The pipeline carries on as if the reroute had sent its copy. The reroute still sets the record's routing fields and runs its on_success processors, and it writes no error.

Earlier copies stay. A freeze doesn't change a copy that was staged or sent for the target before it. A staged copy stays staged. A commit or the end of the record sends it, and a discard can still remove it. So the order of the processors matters:

  • A discard followed by a freeze sends nothing to the target. The discard removes the staged copy, and the freeze stops any later copy.
  • A freeze on its own keeps the copy that is staged now. A later reroute cannot replace it with another copy.

The lock lasts one record. It ends with an unfreeze or at the end of the record. The next record starts with no target locked.

Clones share the lock. A pipeline called with clone: true works on a copy of the record, but it shares the record's locks, as it shares the record's staged copies. A freeze inside a clone, or in the on_drop processors of a pipeline call, also locks the target for the calling pipeline.

Records held from earlier still go out. A freeze holds back only the current record's own copies. aggregate, series_aggregate and tail_sample send records that they built from, or held back from, earlier records. Those records still reach a locked target.

An empty template locks nothing. The freeze uses destination when it is set, and target otherwise. When the field it uses is a template that comes out empty, the freeze locks no target and succeeds. It does not fall back to target. This happens, for example, when a route leaves the setting that names a target blank because it has no such target.

In the pipeline debugger, a reroute to a locked target shows as Skipped, not as an error.

Examples​

Send Nothing to One Target​

A Syslog copy is staged for Sentinel. The record should not reach Sentinel in any form...

- reroute:
target: sentinel
table: Syslog
staging: true
- discard:
target: sentinel
- freeze:
target: sentinel
- reroute:
target: sentinel
table: ASimNetworkSessionLogs
staging: true

The discard removes the Syslog copy, and the freeze stops the ASIM copy:

# sentinel receives nothing

Keep the Copy Staged Now​

A CommonSecurityLog copy is staged for Sentinel before the freeze...

- reroute:
target: sentinel
table: CommonSecurityLog
staging: true
- freeze:
target: sentinel
- reroute:
target: sentinel
table: ASimNetworkSessionLogs
staging: true

The later reroute cannot replace it:

# sentinel receives the CommonSecurityLog copy

Lock a Target When a Filter Drops the Record​

A filter pipeline runs on a copy of the record. When it drops the record, on_drop removes Sentinel's staged copy and locks Sentinel...

- pipeline:
name: '{{ IngestPipeline "csl-filters" }}'
clone: true
on_drop:
- discard:
target: sentinel
ignore_failure: true
- freeze:
target: sentinel
- reroute:
target: sentinel
table: ASimNetworkSessionLogs
staging: true
- reroute:
target: blob
staging: true

The pipeline carries on after the clone. Only Sentinel is affected:

# sentinel receives nothing
# blob receives its copy