-
Notifications
You must be signed in to change notification settings - Fork 413
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
Comments
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. |
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: and the following hangs forever: 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). |
… 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)
… 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)
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.
The text was updated successfully, but these errors were encountered: