# Logstash Input plugin for Elasticsearch to query once based on scedule instead of scrolling

**URL:** <https://discuss.elastic.co/t/logstash-input-plugin-for-elasticsearch-to-query-once-based-on-scedule-instead-of-scrolling/322931>\
**Category:** Logstash\
**Created:** [January 11, 2023, 1:21pm UTC](https://discuss.elastic.co/t/logstash-input-plugin-for-elasticsearch-to-query-once-based-on-scedule-instead-of-scrolling/322931 "2023-01-11T13:21:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahil\_sawhney](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sahil_sawhney/32/88932_2.png) [@sahil\_sawhney](https://discuss.elastic.co/u/sahil_sawhney)\
**Post date:** [January 11, 2023, 1:21pm UTC](https://discuss.elastic.co/t/logstash-input-plugin-for-elasticsearch-to-query-once-based-on-scedule-instead-of-scrolling/322931/1 "2023-01-11T13:21:39Z")

</div>

![Screenshot 2023-01-11 at 6.48.08 PM](https://us1.discourse-cdn.com/elastic/original/3X/2/f/2fc5213d5c8d1899c6a2a6c2a375f4ea368ba5e1.png)

As visible in the screenshot for 1-minute duration, the data is queried multiple times. I wish to disable this and for a schedule "\* \* \* \* \*" collect data only once in 1 minute. My current config for logstash input plugin is as follows:

```auto
input {
    elasticsearch {
        hosts => "http://localhost:9200"
        index => "*-prod-*"
        docinfo => true
        query => '{
            "query": {
                "bool": {
                    "filter": {
                        "range": {
                            "@timestamp": {
                                "gte": "now-1m"
                            }
                        }
                    }
                }
            }
        }'
        schedule => "* * * * *" 
    }
}

```

---

<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:** [February 8, 2023, 1:22pm UTC](https://discuss.elastic.co/t/logstash-input-plugin-for-elasticsearch-to-query-once-based-on-scedule-instead-of-scrolling/322931/2 "2023-02-08T13:22:34Z")

</div>

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