# File not loaded entirely using stdin plugin

**URL:** https://discuss.elastic.co/t/file-not-loaded-entirely-using-stdin-plugin/148645
**Category:** Logstash
**Created:** [September 14, 2018, 3:13pm UTC](https://discuss.elastic.co/t/file-not-loaded-entirely-using-stdin-plugin/148645 "2018-09-14T15:13:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![\_kml](https://avatars.discourse-cdn.com/v4/letter/_/76d3ee/32.png) [@\_kml](https://discuss.elastic.co/u/_kml)
#### Post date: [September 14, 2018, 3:13pm UTC](https://discuss.elastic.co/t/file-not-loaded-entirely-using-stdin-plugin/148645/1 "2018-09-14T15:13:58Z")

</div>

I am using stdin plugin to load a file of about 2500 events, parse it and then write it to elasticsearch, so what I have is:  
$ cat file | ./bin/logstash -f config/myconfig.conf

but what I have is that only about 600 events only are written to elasticsearch.

Afetr that, when I run the command:

$ ./bin/logstash -f config/myconfig.conf

the remaining part of the file is then handled.

do I have a problem with buffering? Can anyone help or expalin what is the problem?

---

<div class="post-metadata">

### Author: ![\_kml](https://avatars.discourse-cdn.com/v4/letter/_/76d3ee/32.png) [@\_kml](https://discuss.elastic.co/u/_kml)
#### Post date: [September 14, 2018, 3:48pm UTC](https://discuss.elastic.co/t/file-not-loaded-entirely-using-stdin-plugin/148645/2 "2018-09-14T15:48:32Z")

</div>

The problem is: I had in my logstash.yml:  
queue.type: persisted  
the default value is memory, when I commented this, it worked.

---

<div class="post-metadata">

### Author: ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)
#### Post date: [September 15, 2018, 9:20pm UTC](https://discuss.elastic.co/t/file-not-loaded-entirely-using-stdin-plugin/148645/3 "2018-09-15T21:20:22Z")

</div>

As a folow-up, enabling `queue.drain` is a way to resolve this with the persistent queue enabled.

Here's why:

- when the stdin input reaches EOF, it shuts itself down
- when a pipeline has no active inputs, it initiates shutdown
- the memory queue, and the persistent queue in drain-mode, hold the pipeline open until all wueued events are processed
- the persistent queue _without_ drain-mode allows the pipeline to shut down immediately, since the event's have safely been spooled to disk.

---

<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 13, 2018, 9:20pm UTC](https://discuss.elastic.co/t/file-not-loaded-entirely-using-stdin-plugin/148645/4 "2018-10-13T21:20:23Z")

</div>

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