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

**URL:** <https://discuss.elastic.co/t/keep-getting-failed-to-install-template-undefined-method-for-nil-nilclass/105297>\
**Category:** Logstash\
**Created:** [October 25, 2017, 8:43pm UTC](https://discuss.elastic.co/t/keep-getting-failed-to-install-template-undefined-method-for-nil-nilclass/105297 "2017-10-25T20:43:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![magdieldominguez](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@magdieldominguez](https://discuss.elastic.co/u/magdieldominguez)\
**Post date:** [October 25, 2017, 8:43pm UTC](https://discuss.elastic.co/t/keep-getting-failed-to-install-template-undefined-method-for-nil-nilclass/105297/1 "2017-10-25T20:43:56Z")

</div>

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](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](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",

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 22, 2017, 8:44pm UTC](https://discuss.elastic.co/t/keep-getting-failed-to-install-template-undefined-method-for-nil-nilclass/105297/2 "2017-11-22T20:44:10Z")

</div>

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