# Grok pattern won't match

**URL:** <https://discuss.elastic.co/t/grok-pattern-wont-match/93059>\
**Category:** Logstash\
**Created:** [July 13, 2017, 5:05pm UTC](https://discuss.elastic.co/t/grok-pattern-wont-match/93059 "2017-07-13T17:05:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sentinel](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sentinel](https://discuss.elastic.co/u/sentinel)\
**Post date:** [July 13, 2017, 5:05pm UTC](https://discuss.elastic.co/t/grok-pattern-wont-match/93059/1 "2017-07-13T17:05:53Z")

</div>

I have this pattern:  
2017-07-13T00:00:04,621 [WARN][Client-Push:1:3][PfFwdPointSubscriptionService] SEKHKD is disabled  
I am able to match up to [client push1:3]

Using this:  
\A%{TIMESTAMP\_ISO8601:timestamp}\s+[%{LOGLEVEL:loglevel}\s+][(?(?:[A-Za-z0-]_:[0-9]:[0-9]))](?(?:[[^.$]_]))

I need to get rid of the square brackets by PfFwdPointSubscriptionService. Seems simple but I may be missing something.

{  
"timestamp": [  
[  
"2017-07-13T00:00:04,621"  
]  
],  
"loglevel": [  
[  
"WARN"  
]  
],  
"thread": [  
[  
"Client-Push:1:3"  
]  
],  
"bean": [  
[  
**"[PfFwdPointSubscriptionService]"**  
]  
]  
}

---

<div class="post-metadata">

**Author:** ![Makra](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Makra](https://discuss.elastic.co/u/Makra)\
**Post date:** [July 13, 2017, 5:46pm UTC](https://discuss.elastic.co/t/grok-pattern-wont-match/93059/2 "2017-07-13T17:46:19Z")

</div>

> [@sentinel](#):
>
> [%{LOGLEVEL:loglevel}\s+]

For the following log-\>

`2017-07-13T00:00:04,621 [WARN][Client-Push:1:3][PfFwdPointSubscriptionService] SEKHKD is disabled`

The Grok pattern is -\>

`^%{TIMESTAMP_ISO8601:timestamp},%{NUMBER:tz} \[%{LOGLEVEL:loglevel} \]\[%{GREEDYDATA:client_push}\]\[%{GREEDYDATA:Service}\] %{GREEDYDATA:msg}`

Output in [https://grokdebug.herokuapp.com/](https://grokdebug.herokuapp.com/)

```
{
  "timestamp": [
    [
      "2017-07-13T00:00:04"
    ]
  ],
  "tz": [
    [
      "621"
    ]
  ],
  "loglevel": [
    [
      "WARN"
    ]
  ],
  "client_push": [
    [
      "Client-Push:1:3"
    ]
  ],
  "Service": [
    [
      "PfFwdPointSubscriptionService"
    ]
  ],
  "msg": [
    [
      "SEKHKD is disabled"
    ]
  ]
}

```

---

<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:** [August 10, 2017, 5:46pm UTC](https://discuss.elastic.co/t/grok-pattern-wont-match/93059/3 "2017-08-10T17:46:51Z")

</div>

Closed on August 10, 2017, 5:46pm UTC

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