﻿---
title: Math processor
description: The Math processor evaluates arithmetic or logical expressions and stores the result in the target field. To calculate a value using an expression and...
url: https://www.elastic.co/elastic/docs-builder/docs/2989/solutions/observability/streams/management/extract/math
products:
  - Elastic Cloud Enterprise
  - Elastic Cloud Hosted
  - Elastic Cloud Serverless
  - Elastic Cloud on Kubernetes
  - Elastic Observability
  - Elastic Stack
  - Elasticsearch
  - Kibana
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available since 9.3
---

# Math processor
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:
1. Select **Create** → **Create processor**.
2. Select **Math** from the **Processor** menu.
3. Set the **Target field** where you want to write the expression result.
4. Set your expression in the **Expression** field. You can directly reference fields in your expression (for example, `bytes / duration`).


## YAML reference

In [YAML mode](/elastic/docs-builder/docs/2989/solutions/observability/streams/management/extract#streams-editing-yaml-mode), configure the math processor using the following parameters. For the complete Streamlang syntax, refer to the [Streamlang reference](https://www.elastic.co/elastic/docs-builder/docs/2989/solutions/observability/streams/management/streamlang).

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

```yaml
- action: math
  expression: "attributes.duration_ms / 1000"
  to: attributes.duration_s
```