Expressions give the config flexibility by allowing dynamic business logic rules to be included in static configs. Most notably, expressions can be used to route messages and add new fields based on the contents of the log entry being processed.
For reference documentation of the expression language, see here.
Available to the expressions are a few special variables:
$record
contains the entry's record$labels
contains the entry's labels$resource
contains the entry's resource$timestamp
contains the entry's timestampenv()
is a function that allows you to read environment variables
- type: metadata
labels:
stack: 'EXPR(env("STACK"))'