# Logstash with elasticsearch input and output keep looping results forever

**URL:** <https://discuss.elastic.co/t/logstash-with-elasticsearch-input-and-output-keep-looping-results-forever/169632>\
**Category:** Logstash\
**Created:** [February 22, 2019, 9:15pm UTC](https://discuss.elastic.co/t/logstash-with-elasticsearch-input-and-output-keep-looping-results-forever/169632 "2019-02-22T21:15:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksemaev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ksemaev/32/41079_2.png) [@ksemaev](https://discuss.elastic.co/u/ksemaev)\
**Post date:** [February 22, 2019, 9:15pm UTC](https://discuss.elastic.co/t/logstash-with-elasticsearch-input-and-output-keep-looping-results-forever/169632/1 "2019-02-22T21:15:09Z")

</div>

The issue is absolutely equal to [Logstash with elasticsearch input and output keep looping results](https://discuss.elastic.co/t/logstash-with-elasticsearch-input-and-output-keep-looping-results/115031)

I have one elastic index as input, and another as output. I've played with `scroll` and `size` options - the result is the same: docs from first index keep adding to new index non-stop.  
I've started with 20 mln docs index and scroll=360m, but after ~180min index was reindexed and kept on filling with dublicated data.

I then tried with smaller indexes with 100k docs - the behaviour is the same. Should logstash even stop after the whole input index was read and reindexed, or it will run in cycle forever?

Current config is:

```auto
input {
  elasticsearch {
   hosts => ["http://111.us-east-1.elb.amazonaws.com:9200"]
   index => "first"
   size => 10000
   scroll => "360m"
  }
}

filter {
    mutate {
        convert => {
            "[query][from]" => "string"
            "[query][to]" => "string"
        }
    }
}

output {
  elasticsearch {
    hosts => ["http://111.us-east-1.elb.amazonaws.com:9200"]
    index => "second"
    sniffing => false
  }
}

```

---

<div class="post-metadata">

**Author:** ![ksemaev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ksemaev/32/41079_2.png) [@ksemaev](https://discuss.elastic.co/u/ksemaev)\
**Post date:** [February 22, 2019, 9:17pm UTC](https://discuss.elastic.co/t/logstash-with-elasticsearch-input-and-output-keep-looping-results-forever/169632/2 "2019-02-22T21:17:20Z")

</div>

@OvBalaban did you manage to resolve that one somehow a year ago ? 😅

---

<div class="post-metadata">

**Author:** ![ksemaev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ksemaev/32/41079_2.png) [@ksemaev](https://discuss.elastic.co/u/ksemaev)\
**Post date:** [February 22, 2019, 9:17pm UTC](https://discuss.elastic.co/t/logstash-with-elasticsearch-input-and-output-keep-looping-results-forever/169632/3 "2019-02-22T21:17:49Z")

</div>

@guyboertje maybe you can explain this one please ?

---

<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:** [March 22, 2019, 9:18pm UTC](https://discuss.elastic.co/t/logstash-with-elasticsearch-input-and-output-keep-looping-results-forever/169632/4 "2019-03-22T21:18:01Z")

</div>

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