# Add 1 filed is sum of other field in logstash

**URL:** <https://discuss.elastic.co/t/add-1-filed-is-sum-of-other-field-in-logstash/70832>\
**Category:** Logstash\
**Created:** [January 7, 2017, 2:50am UTC](https://discuss.elastic.co/t/add-1-filed-is-sum-of-other-field-in-logstash/70832 "2017-01-07T02:50:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tr\_ng\_Trang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tr_ng_trang/32/13053_2.png) [@Tr\_ng\_Trang](https://discuss.elastic.co/u/Tr_ng_Trang)\
**Post date:** [January 7, 2017, 2:50am UTC](https://discuss.elastic.co/t/add-1-filed-is-sum-of-other-field-in-logstash/70832/1 "2017-01-07T02:50:40Z")

</div>

i have 2 filed is number is **upbyte** and **downbyte** , and i want to add 1 filed is bandwith (sum of there) in logstash, how can i do this?

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [January 7, 2017, 6:17am UTC](https://discuss.elastic.co/t/add-1-filed-is-sum-of-other-field-in-logstash/70832/2 "2017-01-07T06:17:47Z")

</div>

Try the aggregation filter

> **[Aggregate filter plugin | Logstash Reference \[8.11\] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-filters-aggregate.html)**

Or you can always use the ruby filter if all fails

> **[Ruby filter plugin | Logstash Reference \[8.11\] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-filters-ruby.html)**

Sort of an example

> [@Logstash Ruby filter to subtract difference between two timestamps in single event](https://discuss.elastic.co/t/logstash-ruby-filter-to-subtract-difference-between-two-timestamps-in-single-event/32580):
>
> Hi, I'm trying to demonstrate the feasability of switching from a Splunk solution to an ELK (Elasticsearch, Logstash and Kibana) stack (with Redis) solution for log analysis and triggering alerts. I have a requirement (due to a legacy application on a system with performace issues which is not the ELK stack server) to add a field at the time of indexing to events that shows the difference between two timestamps from the the same event (so I can't use the logstash elapsed filter plugin as that …

---

<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 4, 2017, 6:17am UTC](https://discuss.elastic.co/t/add-1-filed-is-sum-of-other-field-in-logstash/70832/3 "2017-02-04T06:17:47Z")

</div>

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