# Cant parse correctly

**URL:** <https://discuss.elastic.co/t/cant-parse-correctly/209671>\
**Category:** Logstash\
**Created:** [November 27, 2019, 11:42am UTC](https://discuss.elastic.co/t/cant-parse-correctly/209671 "2019-11-27T11:42:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandros888](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Alexandros888](https://discuss.elastic.co/u/Alexandros888)\
**Post date:** [November 27, 2019, 11:42am UTC](https://discuss.elastic.co/t/cant-parse-correctly/209671/1 "2019-11-27T11:42:52Z")

</div>

Hello,

I want to parse the following message:

\<155\>##preprod\_AISAMSWEB##: 2019-11-25 16:08:34,876 [ERROR] QT\_WebEvents - System.InvalidOperationException: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.

I parse it with the following Grok Pattern:

\<%{NUMBER:u\_n\_1}\>%{GREEDYDATA:messageTEST}##%{WORD:hostname}##: %{TIMESTAMP\_ISO8601:timestamp} %{DATA:loglevel} %{WORD:logger} %{GREEDYDATA:message}

The results are the following:

{  
"hostname": "preprod\_AISAMSWEB",  
"loglevel": "[ERROR]",  
"logger": "QT\_WebEvents",  
"u\_n\_1": "155",  
"message": "- System.InvalidOperationException: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.",  
"messageTEST": "",  
"timestamp": "2019-11-25 16:08:34,876"  
}

Nevertheless, i want to have the loglevel variable without the symbols.  
I want the loglevel variable to contain the price ERROR instead of [ERROR].

Can someone help?

Thank you

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 27, 2019, 4:39pm UTC](https://discuss.elastic.co/t/cant-parse-correctly/209671/2 "2019-11-27T16:39:34Z")

</div>

Use

```
\[%{DATA:loglevel}\]
```

---

<div class="post-metadata">

**Author:** ![Alexandros888](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Alexandros888](https://discuss.elastic.co/u/Alexandros888)\
**Post date:** [November 28, 2019, 7:14am UTC](https://discuss.elastic.co/t/cant-parse-correctly/209671/3 "2019-11-28T07:14:24Z")

</div>

thank you a lot it works smoothly now :). Where can i find more use cases like this..i mean do you know a link or a book that provides all kind of examples?

---

<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:** [December 26, 2019, 7:14am UTC](https://discuss.elastic.co/t/cant-parse-correctly/209671/4 "2019-12-26T07:14:32Z")

</div>

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