How to debug the logstash file plugin

2019-04-18 01:14发布

Is it possible to log actions of the logstash file plugin? (i.e. what files it tries to send, what errors happen, etc)

4条回答
Summer. ? 凉城
2楼-- · 2019-04-18 01:56

In new version stdout format changed

stdout { codec => rubydebug }
查看更多
做自己的国王
3楼-- · 2019-04-18 02:01

If you want to debug the process itself you may run it like this

/opt/logstash/bin/logstash -f yourconf.conf -v --debug --verbose

UPDATE: Acording to @neeraj-gupta using --debug and --verbose at the same time may cause a problem when trying to see debug logs of cloudwatch and using only --debug is enough.

查看更多
forever°为你锁心
4楼-- · 2019-04-18 02:10

Yes, you can see what files it tries to send, what errors happening through the output section by applying

stdout { codec => rubydebug }

Codec is responsible for giving output. So,here it outputs your event data using the ruby "awesome_print" library.

查看更多
Animai°情兽
5楼-- · 2019-04-18 02:16

* * * This method of debugging is now deprecated - see Max's answer above! * * *

Try adding a stdout output with debug set to true. You should be able to see the entire event object and errors / warnings in your logstash --log or stdout.

input {
   file {
      ...
   }
}
output {
   stdout {
      debug => true
   }
   ...
}

Hope that helps!

查看更多
登录 后发表回答