# Compare Dates in Logstash Pipeline

**URL:** https://discuss.elastic.co/t/compare-dates-in-logstash-pipeline/247415
**Category:** Logstash
**Created:** [September 3, 2020, 3:20pm UTC](https://discuss.elastic.co/t/compare-dates-in-logstash-pipeline/247415 "2020-09-03T15:20:50Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![willemdh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/willemdh/32/16922_2.png) [@willemdh](https://discuss.elastic.co/u/willemdh)
#### Post date: [September 3, 2020, 4:53pm UTC](https://discuss.elastic.co/t/compare-dates-in-logstash-pipeline/247415/2 "2020-09-03T16:53:12Z")

</div>

Welcome @d-ring

I know you can compare two dates that are in the same format (eg ISO8601 ) like this:

```auto
if [date1] <= [date2] {
}

```

But as you say, that would require you to create another date field for 30 days ago.. In this post =\> [Adding 1 day to the date](https://discuss.elastic.co/t/adding-1-day-to-the-date/129168/17)

something similar is done with a ruby filter, please check that out and see if you can make it work. 🙂

Grtz

Willem

---

_[View the full topic](https://discuss.elastic.co/t/compare-dates-in-logstash-pipeline/247415)._
