# How filter twitter input data based on @timestamps field in logstash?

**URL:** <https://discuss.elastic.co/t/how-filter-twitter-input-data-based-on-timestamps-field-in-logstash/66198>\
**Category:** Logstash\
**Created:** [November 16, 2016, 5:01am UTC](https://discuss.elastic.co/t/how-filter-twitter-input-data-based-on-timestamps-field-in-logstash/66198 "2016-11-16T05:01:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamal](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jamal](https://discuss.elastic.co/u/jamal)\
**Post date:** [November 16, 2016, 5:01am UTC](https://discuss.elastic.co/t/how-filter-twitter-input-data-based-on-timestamps-field-in-logstash/66198/1 "2016-11-16T05:01:07Z")

</div>

I want to filter twitter input data based on @timestamp field my mean just get new twitt of twiiter not old twitt,  
any one help to how filter it with logstash-filter-date plugin

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 20, 2016, 4:32pm UTC](https://discuss.elastic.co/t/how-filter-twitter-input-data-based-on-timestamps-field-in-logstash/66198/2 "2016-11-20T16:32:15Z")

</div>

As far as I can tell from reading the plugin's source code, the `@timestamp` field already contains the time when the tweet was made. What you're trying to accomplish is essentially

```nohighlight
if [@timestamp] is older than X days {
  drop { }
}

```

but the Logstash configuration language isn't that expressive. What you can do is have a ruby filter that checks the age of `@timestamp` and adds a tag that you can check the presence of. I don't know off the top of my head exactly what such a filter would look like so unless someone else steps in you'll have to do some digging.

---

<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:** [December 18, 2016, 4:32pm UTC](https://discuss.elastic.co/t/how-filter-twitter-input-data-based-on-timestamps-field-in-logstash/66198/3 "2016-12-18T16:32:24Z")

</div>

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