Keep getting failed to install template undefined method '[]' for nil:NilClass?

I am trying to send information from a logfile to elasticsearch using logstash. I cant seem to find the solution to this error. Any help would be greatly appreciated.

The following is my config file:

input {
file {
path => "/omt/opp/logstash-5.6.1/processingP123.log"
type => "OldLog"
start_position => "beginning"
}
}

filter{
if [type] == "OldLog" {
grok {
match => ["message", "(?%{MONTHNUM}.%{MONTHDAY}.%{YEAR} %{TIME})%{SPACE}(?<P.23.P24.ABK>%{DATA:StatusEvent}:%{SPACE}BkgLeg:?%{SPACE}%{BASE16NUM:BkgLegs})?%{GREEDYDATA:message}"]
}
}
}

output {
if [type] == "OldLog" {
elasticsearch {
index => "testing"
hosts => "http://mon.bev.tuesdcorp.com/elasticsearch"
}
}
}

the config file works when I try to run it locally on my windows computer and the output is localhost:9200 but not when I try to do it on our linux environment. So the grok filter is working. The pipeline also succeeds in starting but no information is sent.

The error I receive is:

:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAuthCache).
log4j:WARN Please initialize the log4j system properly.
[2017-10-25T15:25:09,207][WARN ][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>"http://mon.bev.tuesdcorp.com:9200/elasticsearch"}
[2017-10-25T15:25:09,211][INFO ][logstash.outputs.elasticsearch] Using mapping template from {:path=>nil}
[2017-10-25T15:25:09,273][ERROR][logstash.outputs.elasticsearch] Failed to install template. {:message=>"undefined method `[]' for nil:NilClass", :class=>"NoMethodError",

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.