In a config modifier schema, use omit to conditionally remove or exclude a specific field or value from a processed payload. Although it’s the first keyword in order of execution, you should use it in the context of a conditional keyword like one of the following, then set omit:true to remove a field or value:
- switch
- if
This keyword executes in the following order:
- omit
- constant
- references
- use
- get
- Mutually exclusive keywords at this level:
- properties
- if
- concat
- switch
- pipe
- merge
- prefer
- items
- default
- plugin
You can specify that a processed payload should omit an observation if its values match the terms you define.
Example: Observations input from initial payload
json
Example: Observations selector
json
Example: Config modifier with omit keyword
yaml
If the observation values match the values defined in the schema, the then action executes (i.e., the observation is omitted from the processed payload). If the values don’t match, the else action executes (i.e., the payload passes through with the observation).
Example: Observations output
json