# Bug: Logstash grok with empty match is impossible to debug

**URL:** https://discuss.elastic.co/t/bug-logstash-grok-with-empty-match-is-impossible-to-debug/105442
**Category:** Logstash
**Created:** [October 26, 2017, 2:50pm UTC](https://discuss.elastic.co/t/bug-logstash-grok-with-empty-match-is-impossible-to-debug/105442 "2017-10-26T14:50:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kub1x](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kub1x/32/22185_2.png) [@kub1x](https://discuss.elastic.co/u/kub1x)
#### Post date: [October 26, 2017, 2:50pm UTC](https://discuss.elastic.co/t/bug-logstash-grok-with-empty-match-is-impossible-to-debug/105442/1 "2017-10-26T14:50:25Z")

</div>

Hey,  
our Logstash pipeline config files are generated. There was a bug in our generation system which led to following grog pattern. The pattern was one of MANY patterns and contained override and other clauses as well, so it was not easy to notice the empty match pattern.

```
filter {
  grok {
    match => ["", ""]
  }
}

```

On older versions (2.4 or so) it worked. After update, on Logstash v5.6.3 it throws following exception. The exception doesn't say what is wrong or where in the config file we did the mistake.

```
LogStash::Instrument::MetricNoKeyProvided: LogStash::Instrument::MetricNoKeyProvided
     validate_key! at /home/kub1x/test/logstash-5.6.3/logstash-core/lib/logstash/instrument/metric.rb:74
             gauge at /home/kub1x/test/logstash-5.6.3/logstash-core/lib/logstash/instrument/metric.rb:31
             gauge at /home/kub1x/test/logstash-5.6.3/logstash-core/lib/logstash/instrument/namespaced_metric.rb:32
          register at /home/kub1x/test/logstash-5.6.3/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-3.4.3/lib/logstash/filters/grok.rb:277
              each at org/jruby/RubyHash.java:1342
          register at /home/kub1x/test/logstash-5.6.3/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-3.4.3/lib/logstash/filters/grok.rb:275
          register at /home/kub1x/test/logstash-5.6.3/vendor/jruby/lib/ruby/1.9/forwardable.rb:201
   register_plugin at /home/kub1x/test/logstash-5.6.3/logstash-core/lib/logstash/pipeline.rb:290
  register_plugins at /home/kub1x/test/logstash-5.6.3/logstash-core/lib/logstash/pipeline.rb:301
              each at org/jruby/RubyArray.java:1613
  register_plugins at /home/kub1x/test/logstash-5.6.3/logstash-core/lib/logstash/pipeline.rb:301
     start_workers at /home/kub1x/test/logstash-5.6.3/logstash-core/lib/logstash/pipeline.rb:311
               run at /home/kub1x/test/logstash-5.6.3/logstash-core/lib/logstash/pipeline.rb:235
    start_pipeline at /home/kub1x/test/logstash-5.6.3/logstash-core/lib/logstash/agent.rb:398

```

This is a bug in Logstash grok filter as it should write a valuable message with a line number instead of just throwing an exception.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [October 26, 2017, 3:27pm UTC](https://discuss.elastic.co/t/bug-logstash-grok-with-empty-match-is-impossible-to-debug/105442/2 "2017-10-26T15:27:44Z")

</div>

Yes, I agree. I suggest you file a GitHub issue: [https://github.com/logstash-plugins/logstash-filter-grok/issues/new](https://github.com/logstash-plugins/logstash-filter-grok/issues/new)

---

<div class="post-metadata">

### Author: ![kub1x](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kub1x/32/22185_2.png) [@kub1x](https://discuss.elastic.co/u/kub1x)
#### Post date: [October 29, 2017, 1:11pm UTC](https://discuss.elastic.co/t/bug-logstash-grok-with-empty-match-is-impossible-to-debug/105442/3 "2017-10-29T13:11:55Z")

</div>

Thanks. The wheels are turning 😉

Link for reference:

> <https://github.com/logstash-plugins/logstash-filter-grok/issues/123>

---

<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 26, 2017, 1:12pm UTC](https://discuss.elastic.co/t/bug-logstash-grok-with-empty-match-is-impossible-to-debug/105442/4 "2017-11-26T13:12:17Z")

</div>

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