# How to make an logstash pipeline to run contuously (Elasticsearch input plugin)

**URL:** https://discuss.elastic.co/t/how-to-make-an-logstash-pipeline-to-run-contuously-elasticsearch-input-plugin/285714
**Category:** Logstash
**Created:** [October 1, 2021, 8:31pm UTC](https://discuss.elastic.co/t/how-to-make-an-logstash-pipeline-to-run-contuously-elasticsearch-input-plugin/285714 "2021-10-01T20:31:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Thanura\_Kannangara](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Thanura\_Kannangara](https://discuss.elastic.co/u/Thanura_Kannangara)
#### Post date: [October 1, 2021, 8:31pm UTC](https://discuss.elastic.co/t/how-to-make-an-logstash-pipeline-to-run-contuously-elasticsearch-input-plugin/285714/1 "2021-10-01T20:31:30Z")

</div>

Hey Folks,

I'm running an elastic pipeline to read from Elasticsearch and write documents to an S3 bucket

```auto
input {
  elasticsearch {
    ssl => true
    hosts => ["<Redacted>"]
    user => "<Redacted>"
    password => "<Redacted>"
    index => "<Redacted>"
    query => '{ "query": { "query_string": { "query": "winlog.channel:<Redacted>*" } } }'
  }
}
output {
  s3 {
    aws_credentials_file => "/etc/path/toFile/credentials.yml"
    region => "<Redacted>"
    bucket => "<Redacted>"
    additional_settings => {
      force_path_style => true
      follow_redirects => false
    }
    prefix => "%<Redacted>"
  }
}

```

When I run this, it process all the documents in the index(index alias), and then it get terminated.  
I want to make sure this runs continuously, so that all the new docs that go into the index get re-written to s3. How can I achieve this?

Regards,  
Thanura

---

<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: [October 1, 2021, 9:02pm UTC](https://discuss.elastic.co/t/how-to-make-an-logstash-pipeline-to-run-contuously-elasticsearch-input-plugin/285714/2 "2021-10-01T21:02:35Z")

</div>

You can use the [schedule](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-elasticsearch.html#plugins-inputs-elasticsearch-schedule) option to keep running the query. However, it [cannot](https://github.com/logstash-plugins/logstash-input-elasticsearch/issues/93) keep track of state, so it will fetch the complete result set again and send it to the output.

---

<div class="post-metadata">

### Author: ![Thanura\_Kannangara](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Thanura\_Kannangara](https://discuss.elastic.co/u/Thanura_Kannangara)
#### Post date: [October 2, 2021, 6:38am UTC](https://discuss.elastic.co/t/how-to-make-an-logstash-pipeline-to-run-contuously-elasticsearch-input-plugin/285714/3 "2021-10-02T06:38:41Z")

</div>

@Badger is there any better way to do this.  
I mean to ingest the events to S3 continuously for new events

---

<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: [October 2, 2021, 3:22pm UTC](https://discuss.elastic.co/t/how-to-make-an-logstash-pipeline-to-run-contuously-elasticsearch-input-plugin/285714/4 "2021-10-02T15:22:33Z")

</div>

I do not know of one.

---

<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: [October 30, 2021, 3:22pm UTC](https://discuss.elastic.co/t/how-to-make-an-logstash-pipeline-to-run-contuously-elasticsearch-input-plugin/285714/5 "2021-10-30T15:22:49Z")

</div>

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