# How to handle logstash failures

**URL:** <https://discuss.elastic.co/t/how-to-handle-logstash-failures/36044>\
**Category:** Logstash\
**Created:** [December 1, 2015, 12:45pm UTC](https://discuss.elastic.co/t/how-to-handle-logstash-failures/36044 "2015-12-01T12:45:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sampath\_methuku](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sampath\_methuku](https://discuss.elastic.co/u/sampath_methuku)\
**Post date:** [December 1, 2015, 12:45pm UTC](https://discuss.elastic.co/t/how-to-handle-logstash-failures/36044/1 "2015-12-01T12:45:52Z")

</div>

I am using following logstash configuration to push log file content in to elastic search.

`input { file { path => "/home/testuser/apps/logs/sample-collector-app.log" start_position => "beginning" type => "log" } } output { elasticsearch { hosts => "localhost" index => "testlogs" } }`

but i want to know how to control logstash in case of failure (i.e logstash goes down), then how to make sure that next time i start logstash it won't push events that already pushed,

my requirements is logstash should not push duplicates entries to elastic search.

for example : there are 10 events in log file and logstash push 5 events and some how it went down , next time when i start logstash it should push from 6 the event, not from beginning.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [December 1, 2015, 2:43pm UTC](https://discuss.elastic.co/t/how-to-handle-logstash-failures/36044/2 "2015-12-01T14:43:16Z")

</div>

Logstash's file input does this automatically. [Its documentation](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html) describes in reasonable detail how it works.

---

<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:** [July 6, 2017, 5:20am UTC](https://discuss.elastic.co/t/how-to-handle-logstash-failures/36044/3 "2017-07-06T05:20:35Z")

</div>


