# Grok not working

**URL:** https://discuss.elastic.co/t/grok-not-working/87946
**Category:** Logstash
**Created:** [June 1, 2017, 3:42pm UTC](https://discuss.elastic.co/t/grok-not-working/87946 "2017-06-01T15:42:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Nikhilpawar1985](https://avatars.discourse-cdn.com/v4/letter/n/e68b1a/32.png) [@Nikhilpawar1985](https://discuss.elastic.co/u/Nikhilpawar1985)
#### Post date: [June 1, 2017, 3:42pm UTC](https://discuss.elastic.co/t/grok-not-working/87946/1 "2017-06-01T15:42:35Z")

</div>

Hi ,

with below config  
input {  
beats {  
port =\> 5044  
codec =\> multiline {  
pattern =\> "^%{TIMESTAMP\_ISO8601} "  
negate =\> true  
what =\> previous  
}  
}  
}  
filter {  
grok {  
match =\> { "message" =\> "\[(%{TIMESTAMP\_ISO8601:timestamp\_match})\]%{SPACE}:|:%{SPACE}(?:\s+%{WORD:level})?%{SPACE}:|:%{SPACE}(?:\s+%{USERNAME:hostname})?%{SPACE}:|:%{SPACE}(?:\s+%{GREEDYDATA:coidkey})?%{SPACE}:|:%{SPACE}(?:\s+%{GREEDYDATA:clientinfo})?%{SPACE}:|:%{SPACE}(?:\s+%{IP:clientip})?%{SPACE}:|:%{SPACE}(?:\s+%{GREEDYDATA:Url})?%{SPACE}:|:%{SPACE}(?:\s+%{JAVACLASS:class})?%{SPACE}:|:%{SPACE}%{USER:ident}%{SPACE}(?:\s+%{GREEDYDATA:msg})?$"}  
}  
}  
output {  
stdout { codec =\> rubydebug }

My grok does not work .  
If i replace (%{TIMESTAMP\_ISO8601:timestamp}) for ^(?[[^]]\*]) then it excludes the square brackets [] not fails to identify . can someone suggest how i can include the square brackets

---

<div class="post-metadata">

### Author: ![Nikhilpawar1985](https://avatars.discourse-cdn.com/v4/letter/n/e68b1a/32.png) [@Nikhilpawar1985](https://discuss.elastic.co/u/Nikhilpawar1985)
#### Post date: [June 2, 2017, 5:37pm UTC](https://discuss.elastic.co/t/grok-not-working/87946/2 "2017-06-02T17:37:30Z")

</div>

Found a way around

---

<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: [June 30, 2017, 5:37pm UTC](https://discuss.elastic.co/t/grok-not-working/87946/3 "2017-06-30T17:37:48Z")

</div>

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