# Logstash not stopping after completely reading the file

**URL:** <https://discuss.elastic.co/t/logstash-not-stopping-after-completely-reading-the-file/204805>\
**Category:** Logstash\
**Created:** [October 23, 2019, 7:34am UTC](https://discuss.elastic.co/t/logstash-not-stopping-after-completely-reading-the-file/204805 "2019-10-23T07:34:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harish\_Chander](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harish_chander/32/56385_2.png) [@Harish\_Chander](https://discuss.elastic.co/u/Harish_Chander)\
**Post date:** [October 23, 2019, 7:34am UTC](https://discuss.elastic.co/t/logstash-not-stopping-after-completely-reading-the-file/204805/1 "2019-10-23T07:34:34Z")

</div>

Hi,

My logstash conf is as below.

input {  
s3 {  
access\_key\_id =\> ""  
secret\_access\_key =\> ""  
bucket =\> "tabprod-s3data"  
region =\> "us-west-2"  
}  
}

filter {  
json {  
source =\> "message"  
remove\_field =\> ["message"]  
}  
#mutate {add\_field =\>{"channelId" =\> "indexid" }}  
}

output {  
amazon\_es {  
hosts =\> ["[https://orlvialrzsqaufa5232n3rces.amazonaws.com](https://orlvialrzsqaufa5232n3rces.amazonaws.com)"]  
region =\> "us-west-2"  
aws\_access\_key\_id =\> ""  
aws\_secret\_access\_key =\> ""  
index =\> "channel\_%{channelId}"  
}  
}

I am writing a file from s3 to elasticsearch using logstash.

When I run logstash as a cli command, it works perfectly fine. ( Loads all 200k records from the file).

But If I run it as a service, the logstash keep on loading the same file again and again.  
I have waited for long thinking some problem with the checkpointing, but it loaded till 9 folds and was still continuing.

Where and what should I be checking/modifying to avoid this behaviour?

Thanks,  
Harish

---

<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:** [November 20, 2019, 7:34am UTC](https://discuss.elastic.co/t/logstash-not-stopping-after-completely-reading-the-file/204805/2 "2019-11-20T07:34:38Z")

</div>

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