Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quit logstash forwarder on EOF #251

Open
mieciu opened this issue Aug 20, 2014 · 2 comments
Open

Quit logstash forwarder on EOF #251

mieciu opened this issue Aug 20, 2014 · 2 comments

Comments

@mieciu
Copy link
Contributor

mieciu commented Aug 20, 2014

At first I thought about additional parameter in the config file, something which could work like this: mieciu@2def88f

But then I had realized that a CMD option would be more elegant and comfortable.

At the company I'm working for we had to recover our ELK instance by pushing several log files with logstash-forwarder back to logstash instances. Of course we've set the config to catch STDIN and piped the logfile to the program. It would be perfect to provide logstash-forwarder such a feature, so that after displaying " FIle truncated...." it would exit immediately.

@oppianmatt
Copy link

Yep, this just bit me too. Had it to capture cron jobs outputs overnight, but the processes never end. Feels like if it's accepting stdin it should quit when it gets a eof. No point seeking to beginning of stdin when it's finished.

@rnavarr
Copy link

rnavarr commented Jan 9, 2015

There is indeed a bug in logstash-forwarder. Piping input into its STDIN (with "paths": [ "-" ] set) should end gracefully when the stdin ends. Instead /var/log/messages says:
2015/01/09 01:37:28.196532 File truncated, seeking to beginning: -

and the following hangs forever:
print '' | /opt/logstash-forwarder/bin/logstash-forwarder -config logstash-fwd-mysql-slowquery.conf

I suspect the code is treating a pipe like a file and trying to seek on it. Pipes cannot be seeked on. They can be endless and data is gone once read out (by logstash-forwarder).
R

driskell added a commit to driskell/log-courier that referenced this issue Jan 10, 2015
… remove special "-" file path that previously read from stdin. Log Courier will now read ONLY from stdin when -stdin is specified, using the configuration in the stdin section, and will exit automatically on EOF (Implements elastic/logstash-forwarder#251 and elastic/logstash-forwarder#343)
driskell added a commit to driskell/log-courier that referenced this issue Feb 16, 2020
… remove special "-" file path that previously read from stdin. Log Courier will now read ONLY from stdin when -stdin is specified, using the configuration in the stdin section, and will exit automatically on EOF (Implements elastic/logstash-forwarder#251 and elastic/logstash-forwarder#343)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants