# Calculate new field in logstash config file

**URL:** https://discuss.elastic.co/t/calculate-new-field-in-logstash-config-file/237097
**Category:** Logstash
**Created:** [June 15, 2020, 9:19am UTC](https://discuss.elastic.co/t/calculate-new-field-in-logstash-config-file/237097 "2020-06-15T09:19:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![inchirah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inchirah/32/48145_2.png) [@inchirah](https://discuss.elastic.co/u/inchirah)
#### Post date: [June 15, 2020, 9:19am UTC](https://discuss.elastic.co/t/calculate-new-field-in-logstash-config-file/237097/1 "2020-06-15T09:19:48Z")

</div>

Hello everyone,

I wonder if I can calculate a new fields using the fields in my csv file in the logstash configuration file ![test](https://us1.discourse-cdn.com/elastic/original/3X/a/e/ae70864ff68dfa95b09b201cec3c5005e0997e93.png) .

Priciasly I want to add a field **attempt complaint** (number of observation where **ServRvLevdle** \>= -78)

**percentage = attempt complaint / number of observations**

Can i use mutate function or any other function to get this result??

@flash1293 do you have any idea please ?

---

<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: [July 13, 2020, 9:19am UTC](https://discuss.elastic.co/t/calculate-new-field-in-logstash-config-file/237097/2 "2020-07-13T09:19:49Z")

</div>

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