# NoMethodError: undefined method \`start\_with?' for nil:NilClass

**URL:** <https://discuss.elastic.co/t/nomethoderror-undefined-method-start-with-for-nil-nilclass/35139>\
**Category:** Logstash\
**Created:** [November 20, 2015, 9:55am UTC](https://discuss.elastic.co/t/nomethoderror-undefined-method-start-with-for-nil-nilclass/35139 "2015-11-20T09:55:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunilmchaudhari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sunilmchaudhari/32/9475_2.png) [@sunilmchaudhari](https://discuss.elastic.co/u/sunilmchaudhari)\
**Post date:** [November 20, 2015, 9:55am UTC](https://discuss.elastic.co/t/nomethoderror-undefined-method-start-with-for-nil-nilclass/35139/1 "2015-11-20T09:55:14Z")

</div>

Hi,  
I am trying to send logs to zabbix server using logstash zabbix output.

Sample log file contents

```
2015-11-11 10:27:40.8798 FATAL Some Service Providers are missing data required by FAS: TestServiceProvider-7
2015-11-11 10:29:40.8798 FATAL Some Service Providers are missing data required by FAS: TestServiceProvider-7

```

logstash.conf file as below

```
input {

file {
  type => "FASLoader_alert"
  path => "/opt/logstash/bin/fasAlerts/FASLoader_Alert.log"
}

}

filter {
   grok{

     match => ["@message", "(error|ERROR|CRITICAL|FATAL)"]
     add_tag => ["fas-alerts"]

   # add_field => { "zabbix_host" => "ELK" "zkey" => "hello"}
   }
mutate {
  add_field => { "[@metadata][zabbix_host]" => "log[/opt/logstash/bin/fasAlerts/FASLoader_Alert.log,FATAL]" }
}
   }

output {
stdout { codec => rubydebug }
  zabbix {
        zabbix_host => "[@metadata][zabbix_host]"
        

 }
}

```

When I start logstash, then it shows following error.

```
Logstash startup completed
{
       "message" => "2015-09-03 12:00:40.8798 FATAL Some Service Providers are missing data required by FAS: TestServiceProvider-1",
      "@version" => "1",
    "@timestamp" => "2015-11-20T09:34:09.794Z",
          "host" => "host-namei",
          "path" => "/opt/logstash/bin/fasAlerts/FASLoader_Alert.log",
          "type" => "FASLoader_alert",
          "tags" => [
        [0] "_grokparsefailure"
    ]
}
NoMethodError: undefined method `start_with?' for nil:NilClass
               [] at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/event.rb:126
      field_check at /opt/logstash/vendor/local_gems/9054c277/logstash-output-zabbix-1.0.0/lib/logstash/outputs/zabbix.rb:104
         kv_check at /opt/logstash/vendor/local_gems/9054c277/logstash-output-zabbix-1.0.0/lib/logstash/outputs/zabbix.rb:116
             each at org/jruby/RubyArray.java:1613
         kv_check at /opt/logstash/vendor/local_gems/9054c277/logstash-output-zabbix-1.0.0/lib/logstash/outputs/zabbix.rb:115
  validate_fields at /opt/logstash/vendor/local_gems/9054c277/logstash-output-zabbix-1.0.0/lib/logstash/outputs/zabbix.rb:125
             step at org/jruby/RubyRange.java:578
  validate_fields at /opt/logstash/vendor/local_gems/9054c277/logstash-output-zabbix-1.0.0/lib/logstash/outputs/zabbix.rb:124
   format_request at /opt/logstash/vendor/local_gems/9054c277/logstash-output-zabbix-1.0.0/lib/logstash/outputs/zabbix.rb:138
         tcp_send at /opt/logstash/vendor/local_gems/9054c277/logstash-output-zabbix-1.0.0/lib/logstash/outputs/zabbix.rb:201
             open at org/jruby/RubyIO.java:1183
         tcp_send at /opt/logstash/vendor/local_gems/9054c277/logstash-output-zabbix-1.0.0/lib/logstash/outputs/zabbix.rb:200
   send_to_zabbix at /opt/logstash/vendor/local_gems/9054c277/logstash-output-zabbix-1.0.0/lib/logstash/outputs/zabbix.rb:223
          timeout at org/jruby/ext/timeout/Timeout.java:126
   send_to_zabbix at /opt/logstash/vendor/local_gems/9054c277/logstash-output-zabbix-1.0.0/lib/logstash/outputs/zabbix.rb:222
          receive at /opt/logstash/vendor/local_gems/9054c277/logstash-output-zabbix-1.0.0/lib/logstash/outputs/zabbix.rb:239
           handle at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/outputs/base.rb:88
      output_func at (eval):78
     outputworker at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/pipeline.rb:244
    start_outputs at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/pipeline.rb:166

```

Can anybody tell whats wrong in my configuration?

Zabbix monitoring is running on 127.0.0.1.  
I have created 2 hosts form zabbix frontend as below

 ![](https://us1.discourse-cdn.com/elastic/original/2X/0/0cb19a90dc1a9662b2df555e9bc309866a03e65e.png)

 ![](https://us1.discourse-cdn.com/elastic/original/2X/4/407300525a2e9541fffadaf57a22b9776a43f314.png)

---

<div class="post-metadata">

**Author:** ![sunilmchaudhari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sunilmchaudhari/32/9475_2.png) [@sunilmchaudhari](https://discuss.elastic.co/u/sunilmchaudhari)\
**Post date:** [November 25, 2015, 10:28am UTC](https://discuss.elastic.co/t/nomethoderror-undefined-method-start-with-for-nil-nilclass/35139/2 "2015-11-25T10:28:57Z")

</div>

Hi all,  
any guess what might be the issue?  
Please help.

thanks  
Sunil.

---

<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:** [July 6, 2017, 5:21am UTC](https://discuss.elastic.co/t/nomethoderror-undefined-method-start-with-for-nil-nilclass/35139/3 "2017-07-06T05:21:17Z")

</div>

Closed on July 6, 2017, 5:21am UTC


