# 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:** 1
**Showing post:** 2

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

---

_[View the full topic](https://discuss.elastic.co/t/add-1-filed-is-sum-of-other-field-in-logstash/70832)._
