user626528
user626528

Reputation: 14419

How to debug the logstash file plugin

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

Upvotes: 25

Views: 70921

Answers (4)

Shalini Baranwal
Shalini Baranwal

Reputation: 2998

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.

Upvotes: 2

Mariano Argañaraz
Mariano Argañaraz

Reputation: 1252

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

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

NOTE: According 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.

So realistically something like this is more apt:

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

Upvotes: 15

Becca Gaspard
Becca Gaspard

Reputation: 1257

* * * 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!

Upvotes: 5

Max
Max

Reputation: 4620

In new version stdout format changed

stdout { codec => rubydebug }

Upvotes: 54

Related Questions