# Arithmetic operations in metricbeat processors

**URL:** <https://discuss.elastic.co/t/arithmetic-operations-in-metricbeat-processors/216234>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [January 23, 2020, 12:18pm UTC](https://discuss.elastic.co/t/arithmetic-operations-in-metricbeat-processors/216234 "2020-01-23T12:18:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![naveenbangalore](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@naveenbangalore](https://discuss.elastic.co/u/naveenbangalore)\
**Post date:** [January 23, 2020, 12:18pm UTC](https://discuss.elastic.co/t/arithmetic-operations-in-metricbeat-processors/216234/1 "2020-01-23T12:18:53Z")

</div>

I am trying to add the below metricbeat processor in system.yml file for adding a custom field. It does not throw any error but does not compute and add the field as well. Is it possible to perform arithmetic operations in the metricbeat module yaml files ? If yes, what is the right syntax?

```
- add_fields:
    when:
      range:
        (system.cpu.total.pct/system.cpu.cores):
              gte: 0.3
        (system.cpu.total.pct/system.cpu.cores):
              lt: 0.7
   target: ''
   fields:
     status: AMBER
```

---

<div class="post-metadata">

**Author:** ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)\
**Post date:** [January 23, 2020, 12:45pm UTC](https://discuss.elastic.co/t/arithmetic-operations-in-metricbeat-processors/216234/2 "2020-01-23T12:45:16Z")

</div>

Hi @naveenbangalore 🙂

`add_fields` functionality is limited to what you can see in this link [https://www.elastic.co/guide/en/beats/filebeat/master/add-fields.html](https://www.elastic.co/guide/en/beats/filebeat/master/add-fields.html)

You can achieve something like this with an Ingest pipeline [https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html](https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 20, 2020, 12:45pm UTC](https://discuss.elastic.co/t/arithmetic-operations-in-metricbeat-processors/216234/3 "2020-02-20T12:45:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
