Math processor
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Generally available
Stack
9.3+
Generally available since 9.3
The Math processor evaluates arithmetic or logical expressions and stores the result in the target field.
To calculate a value using an expression and store the result in a target field:
- Select Create → Create processor.
- Select Math from the Processor menu.
- Set the Target field where you want to write the expression result.
- Set your expression in the Expression field. You can directly reference fields in your expression (for example,
bytes / duration).
In YAML mode, configure the math processor using the following parameters. For the complete Streamlang syntax, refer to the Streamlang reference.
| Parameter | Type | Required | Description |
|---|---|---|---|
expression |
string | Yes | A TinyMath expression. Can reference fields directly (for example, attributes.price * attributes.quantity). |
to |
string | Yes | Target field for the result. |
ignore_missing |
boolean | No | When true, skip this processor if any referenced field is missing. |
- action: math
expression: "attributes.duration_ms / 1000"
to: attributes.duration_s