# How to calculate timestamp difference in logstash config file?

**URL:** https://discuss.elastic.co/t/how-to-calculate-timestamp-difference-in-logstash-config-file/244732
**Category:** Logstash
**Created:** [August 12, 2020, 1:58pm UTC](https://discuss.elastic.co/t/how-to-calculate-timestamp-difference-in-logstash-config-file/244732 "2020-08-12T13:58:38Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [August 12, 2020, 2:25pm UTC](https://discuss.elastic.co/t/how-to-calculate-timestamp-difference-in-logstash-config-file/244732/2 "2020-08-12T14:25:10Z")

</div>

Parse them both using date filters, then use ruby to calculate the difference. Something like [this](https://discuss.elastic.co/t/trying-to-calculate-differences-between-2-timestamps/242443/2).

---

_[View the full topic](https://discuss.elastic.co/t/how-to-calculate-timestamp-difference-in-logstash-config-file/244732)._
