# New to logstash: file input and stdout output not working

**URL:** <https://discuss.elastic.co/t/new-to-logstash-file-input-and-stdout-output-not-working/1140>\
**Category:** Logstash\
**Created:** [May 22, 2015, 1:51am UTC](https://discuss.elastic.co/t/new-to-logstash-file-input-and-stdout-output-not-working/1140 "2015-05-22T01:51:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaustabhd](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@kaustabhd](https://discuss.elastic.co/u/kaustabhd)\
**Post date:** [May 22, 2015, 1:51am UTC](https://discuss.elastic.co/t/new-to-logstash-file-input-and-stdout-output-not-working/1140/1 "2015-05-22T01:51:43Z")

</div>

I have a logstash config:  
input {  
file {  
path =\> "/home/user/data/trace\_collector.log"  
}  
}  
filter {  
grok {  
match =\> { "message" =\> "%{GREEDYDATA: log}" }  
}  
}  
output {  
stdout {}  
}

I am expecting that this will spit out the lines from the files verbatim. However, I dont see anything on the stdout when I run logstash -f xx.conf

If I change the input from file to stdin, then logstash prints out whatever I write , as expected. Am I not understanding how to use file plugin for stdin?

---

<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:** [May 22, 2015, 7:03am UTC](https://discuss.elastic.co/t/new-to-logstash-file-input-and-stdout-output-not-working/1140/2 "2015-05-22T07:03:10Z")

</div>

You've probably processed the file before and then Logstash will remember what you've read and only tail the end of the file. If you want the file processed from the beginning you have to

- delete its sincedb file (or set sincedb\_path to null for the file input), and
- set start\_position to beginning.

You can confirm that this is the problem by appending a line to the log (`echo foo >> /home/user/data/trace_collector.log`).

---

<div class="post-metadata">

**Author:** ![kaustabhd](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@kaustabhd](https://discuss.elastic.co/u/kaustabhd)\
**Post date:** [May 22, 2015, 10:26pm UTC](https://discuss.elastic.co/t/new-to-logstash-file-input-and-stdout-output-not-working/1140/3 "2015-05-22T22:26:50Z")

</div>

Thank you. That was it.  
I was able to see foo being parsed and printed as you mentioned.

---

<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:39am UTC](https://discuss.elastic.co/t/new-to-logstash-file-input-and-stdout-output-not-working/1140/4 "2017-07-06T05:39:27Z")

</div>


