Last active
April 29, 2017 06:05
-
-
Save dwbutler/8f1a779c5b29055c9d1c2bb2d6d607fb to your computer and use it in GitHub Desktop.
LogStashLogger TCP downage error handling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ logstash -f samples/tcp.conf | |
Settings: Default pipeline workers: 8 | |
Pipeline main started | |
{"message":"\"2017-04-28T22:44:30.424-07:00\"","@timestamp":"2017-04-29T05:44:30.424Z","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local","port":62671} | |
{"message":"\"2017-04-28T22:44:30.528-07:00\"","@timestamp":"2017-04-29T05:44:30.528Z","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local","port":62671} | |
{"message":"\"2017-04-28T22:44:30.633-07:00\"","@timestamp":"2017-04-29T05:44:30.633Z","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local","port":62671} | |
{"message":"\"2017-04-28T22:44:30.737-07:00\"","@timestamp":"2017-04-29T05:44:30.737Z","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local","port":62671} | |
{"message":"\"2017-04-28T22:44:30.842-07:00\"","@timestamp":"2017-04-29T05:44:30.842Z","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local","port":62671} | |
{"message":"\"2017-04-28T22:44:30.947-07:00\"","@timestamp":"2017-04-29T05:44:30.947Z","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local","port":62671} | |
^CSIGINT received. Shutting down the agent. {:level=>:warn} | |
stopping pipeline {:id=>"main"} | |
Pipeline main has been shutdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logger = LogStashLogger.new( | |
type: :multi_delegator, | |
outputs: [ | |
{ type: :file, path: "test.log" }, | |
{ type: :tcp, port: 5228} | |
]) | |
loop { logger.info(Time.now); sleep(0.1)} | |
E, [2017-04-28T22:44:36.020367 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::EPIPE - Broken pipe | |
E, [2017-04-28T22:44:36.020429 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::EPIPE - Broken pipe | |
W, [2017-04-28T22:44:36.245285 #75259] WARN -- : [LogStashLogger::Device::TCP] Buffer Full - {:pending=>50, :outgoing=>0} | |
E, [2017-04-28T22:44:41.025441 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::ECONNREFUSED - Connection refused - connect(2) for "0.0.0.0" port 5228 | |
W, [2017-04-28T22:44:41.453910 #75259] WARN -- : [LogStashLogger::Device::TCP] Buffer Full - {:pending=>50, :outgoing=>0} | |
E, [2017-04-28T22:44:46.029905 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::ECONNREFUSED - Connection refused - connect(2) for "0.0.0.0" port 5228 | |
W, [2017-04-28T22:44:46.658487 #75259] WARN -- : [LogStashLogger::Device::TCP] Buffer Full - {:pending=>50, :outgoing=>0} | |
E, [2017-04-28T22:44:51.033723 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::ECONNREFUSED - Connection refused - connect(2) for "0.0.0.0" port 5228 | |
W, [2017-04-28T22:44:51.856597 #75259] WARN -- : [LogStashLogger::Device::TCP] Buffer Full - {:pending=>50, :outgoing=>0} | |
E, [2017-04-28T22:44:56.038273 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::ECONNREFUSED - Connection refused - connect(2) for "0.0.0.0" port 5228 | |
W, [2017-04-28T22:44:57.056995 #75259] WARN -- : [LogStashLogger::Device::TCP] Buffer Full - {:pending=>50, :outgoing=>0} | |
E, [2017-04-28T22:45:01.040617 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::ECONNREFUSED - Connection refused - connect(2) for "0.0.0.0" port 5228 | |
W, [2017-04-28T22:45:02.248668 #75259] WARN -- : [LogStashLogger::Device::TCP] Buffer Full - {:pending=>50, :outgoing=>0} | |
E, [2017-04-28T22:45:06.043476 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::ECONNREFUSED - Connection refused - connect(2) for "0.0.0.0" port 5228 | |
W, [2017-04-28T22:45:07.459803 #75259] WARN -- : [LogStashLogger::Device::TCP] Buffer Full - {:pending=>50, :outgoing=>0} | |
E, [2017-04-28T22:45:11.046886 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::ECONNREFUSED - Connection refused - connect(2) for "0.0.0.0" port 5228 | |
W, [2017-04-28T22:45:12.648717 #75259] WARN -- : [LogStashLogger::Device::TCP] Buffer Full - {:pending=>50, :outgoing=>0} | |
E, [2017-04-28T22:45:16.051065 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::ECONNREFUSED - Connection refused - connect(2) for "0.0.0.0" port 5228 | |
W, [2017-04-28T22:45:17.862392 #75259] WARN -- : [LogStashLogger::Device::TCP] Buffer Full - {:pending=>50, :outgoing=>0} | |
E, [2017-04-28T22:45:21.055426 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::ECONNREFUSED - Connection refused - connect(2) for "0.0.0.0" port 5228 | |
W, [2017-04-28T22:45:23.062624 #75259] WARN -- : [LogStashLogger::Device::TCP] Buffer Full - {:pending=>50, :outgoing=>0} | |
E, [2017-04-28T22:45:26.059241 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::ECONNREFUSED - Connection refused - connect(2) for "0.0.0.0" port 5228 | |
^CE, [2017-04-28T22:45:27.262267 #75259] ERROR -- : [LogStashLogger::Device::TCP] Errno::ECONNREFUSED - Connection refused - connect(2) for "0.0.0.0" port 5228 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ tail -f test.log | |
{"message":"\"2017-04-28T22:45:26.292-07:00\"","@timestamp":"2017-04-28T22:45:26.292-07:00","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local"} | |
{"message":"\"2017-04-28T22:45:26.395-07:00\"","@timestamp":"2017-04-28T22:45:26.395-07:00","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local"} | |
{"message":"\"2017-04-28T22:45:26.499-07:00\"","@timestamp":"2017-04-28T22:45:26.499-07:00","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local"} | |
{"message":"\"2017-04-28T22:45:26.603-07:00\"","@timestamp":"2017-04-28T22:45:26.603-07:00","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local"} | |
{"message":"\"2017-04-28T22:45:26.707-07:00\"","@timestamp":"2017-04-28T22:45:26.707-07:00","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local"} | |
{"message":"\"2017-04-28T22:45:26.812-07:00\"","@timestamp":"2017-04-28T22:45:26.812-07:00","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local"} | |
{"message":"\"2017-04-28T22:45:26.916-07:00\"","@timestamp":"2017-04-28T22:45:26.916-07:00","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local"} | |
{"message":"\"2017-04-28T22:45:27.021-07:00\"","@timestamp":"2017-04-28T22:45:27.021-07:00","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local"} | |
{"message":"\"2017-04-28T22:45:27.125-07:00\"","@timestamp":"2017-04-28T22:45:27.125-07:00","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local"} | |
{"message":"\"2017-04-28T22:45:27.230-07:00\"","@timestamp":"2017-04-28T22:45:27.230-07:00","@version":"1","severity":"INFO","host":"Davids-MacBook-Pro-6.local"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment