# Periodically run elasticsearch query count only new records

**URL:** <https://discuss.elastic.co/t/periodically-run-elasticsearch-query-count-only-new-records/80160>\
**Category:** Logstash\
**Created:** [March 27, 2017, 3:35pm UTC](https://discuss.elastic.co/t/periodically-run-elasticsearch-query-count-only-new-records/80160 "2017-03-27T15:35:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Exocomp](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@Exocomp](https://discuss.elastic.co/u/Exocomp)\
**Post date:** [March 27, 2017, 3:35pm UTC](https://discuss.elastic.co/t/periodically-run-elasticsearch-query-count-only-new-records/80160/1 "2017-03-27T15:35:19Z")

</div>

Hi,

I'm in need of a running an elasticsearch query periodically, every minute or so, and return a count that is based on new records since the last time the query was executed.

I tried the "http\_poller" input plugin however it doesn't support the ability to store the last timestamp to then filter by, could someone please provide a solution I could try.

Thanks,  
E

---

<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:** [April 24, 2017, 3:35pm UTC](https://discuss.elastic.co/t/periodically-run-elasticsearch-query-count-only-new-records/80160/2 "2017-04-24T15:35:19Z")

</div>

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