Hi ,
I was running logstash in windows environment and it was running fine , but when I was trying the same thing in Linux machine with same version of logstash (1.5.4) it is showing an error
that The error reported is:
undefined method `close' for nil:NilClass
Any idea why ?
Thanks
warkolm
(Mark Walkom)
September 23, 2015, 2:33am
2
What does the config look like?
Providing the full error may also be useful.
Hi @warkolm
conf file is as follow:
input
{
file
{
path => "/elkt/software/data/error.log"
start_position => "beginning"
sincedb_path => "/elkt/data1.sincedb1"
}
}
filter
{
grok
{
patterns_dir => "/elkt/software/logstash-1.5.4/patterns"
match => [ "message" , "%{SYSOUT}"]
}
if[classname] == "java.io.NotSerializableException"
{
mutate
{
remove_field => [ "message" ]
remove_field => [ "@version" ]
remove_field => ["host"]
remove_field => ["path"]
}
}
}
output
{
stdout { codec => rubydebug }
}
SYSOUT pattern : SYSOUT %{SYSLOG5424SD:date} %{NUMBER:id} %{WORD:waseid} %{GREEDYDATA:data} exception "%{JAVACLASS:classname}" with message "%{JAVACLASS:classname2}". %{GREEDYDATA:additionalinfo}
That is the full error what I am getting after running the logstash
[elkt@server_name bin]$ ./logstash -f syslogs.conf
The error reported is:
undefined method `close' for nil:NilClass
[elkt@server_name bin]$
andrewvc
(andrewvc)
September 24, 2015, 1:42pm
6
Navneet, can you run this with --debug so we can get the full error information? That should printout a stack trace with it.
Hi @andrewvc after --debug I am gettting this
The error reported is:
undefined method close' for nil:NilClass /elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb:83:in
add_patterns_from_file'
/elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-1.0.0/lib/logstash/filters/grok.rb:361:in add_patterns_from_files' org/jruby/RubyArray.java:1613:in
each'
/elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-1.0.0/lib/logstash/filters/grok.rb:357:in add_patterns_from_files' /elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-1.0.0/lib/logstash/filters/grok.rb:269:in
register'
org/jruby/RubyArray.java:1613:in each' /elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-1.0.0/lib/logstash/filters/grok.rb:265:in
register'
org/jruby/RubyHash.java:1341:in each' /elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-1.0.0/lib/logstash/filters/grok.rb:261:in
register'
org/jruby/RubyArray.java:1613:in each' /elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/pipeline.rb:155:in
start_filters'
/elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/pipeline.rb:82:in run' /elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/agent.rb:155:in
execute'
/elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/runner.rb:90:in run' org/jruby/RubyProc.java:271:in
call'
/elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/runner.rb:95:in run' org/jruby/RubyProc.java:271:in
call'
/elkt/software/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/stud-0.0.21/lib/stud/task.rb:12:in `initialize'