# Grok pattern OK in debugger, but parse failure in logstash

**URL:** https://discuss.elastic.co/t/grok-pattern-ok-in-debugger-but-parse-failure-in-logstash/220405
**Category:** Logstash
**Created:** [February 21, 2020, 3:26pm UTC](https://discuss.elastic.co/t/grok-pattern-ok-in-debugger-but-parse-failure-in-logstash/220405 "2020-02-21T15:26:26Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![argnist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/argnist/32/45618_2.png) [@argnist](https://discuss.elastic.co/u/argnist)
#### Post date: [February 21, 2020, 3:26pm UTC](https://discuss.elastic.co/t/grok-pattern-ok-in-debugger-but-parse-failure-in-logstash/220405/1 "2020-02-21T15:26:26Z")

</div>

Hello everyone.  
I wrote grok pattern, checked it in debugger in Kibana.  
Grok pattern OK in debugger, but in logstash i got parse failure.  
I tried to debug pattern in logstash with  
~/logstash/bin/logstash --path.settings=~/logstash/config -f ~/logstash/config/test.conf --log.level=debug --config.debug \> ~/debug.txt  
but can't find related output in file ~/debug.txt and/or stdout  
Please, tell me what I'm doing wrong?

---

<div class="post-metadata">

### Author: ![argnist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/argnist/32/45618_2.png) [@argnist](https://discuss.elastic.co/u/argnist)
#### Post date: [February 24, 2020, 7:40am UTC](https://discuss.elastic.co/t/grok-pattern-ok-in-debugger-but-parse-failure-in-logstash/220405/2 "2020-02-24T07:40:45Z")

</div>

inside my config:  
input {  
file {  
path =\> "/home/me/test.txt"  
sincedb\_path =\> "/home/me/tmp"  
start\_position =\> "beginning"  
}  
}

```
filter {
  grok {
    match => { "message" => "%{TIMESTAMP_ISO8601:time}%{GREEDYDATA}%{SPACE}Execute%{SPACE}%{WORD:execute}\([channel\(\\"%{WORD:channel}%{GREEDYDATA:test28}" }
  }
}

output {
  stdout { codec => rubydebug }
  file {
    codec => "plain"
    path => "/home/me/log.txt"
  }
}
```

---

<div class="post-metadata">

### Author: ![ITIC](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ITIC](https://discuss.elastic.co/u/ITIC)
#### Post date: [February 25, 2020, 9:11am UTC](https://discuss.elastic.co/t/grok-pattern-ok-in-debugger-but-parse-failure-in-logstash/220405/3 "2020-02-25T09:11:32Z")

</div>

Hi

Can you provide a sample of your input? You could comment out your entire `filter{}` section and see what you get at `stdout{}`.

Hope this helps.

---

<div class="post-metadata">

### Author: ![argnist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/argnist/32/45618_2.png) [@argnist](https://discuss.elastic.co/u/argnist)
#### Post date: [February 26, 2020, 8:14am UTC](https://discuss.elastic.co/t/grok-pattern-ok-in-debugger-but-parse-failure-in-logstash/220405/4 "2020-02-26T08:14:05Z")

</div>

I'm tried to find out something helpful in debug output for 2 hours, and when I escaped everything with right number of slashes of one, debug output lost two lines which l can't to connect with my problem. But finally I got it. Logstash debug will never helps me.  
Thank you for everything.

---

<div class="post-metadata">

### Author: ![argnist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/argnist/32/45618_2.png) [@argnist](https://discuss.elastic.co/u/argnist)
#### Post date: [February 26, 2020, 9:30am UTC](https://discuss.elastic.co/t/grok-pattern-ok-in-debugger-but-parse-failure-in-logstash/220405/5 "2020-02-26T09:30:52Z")

</div>

I'm find out solution in wrong number of slashes escaping special characters in my pattern.

---

<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: [March 25, 2020, 9:30am UTC](https://discuss.elastic.co/t/grok-pattern-ok-in-debugger-but-parse-failure-in-logstash/220405/6 "2020-03-25T09:30:53Z")

</div>

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