# Grokparsefailure message in the case of using grok filter

**URL:** <https://discuss.elastic.co/t/grokparsefailure-message-in-the-case-of-using-grok-filter/197275>\
**Category:** Logstash\
**Created:** [August 29, 2019, 7:52am UTC](https://discuss.elastic.co/t/grokparsefailure-message-in-the-case-of-using-grok-filter/197275 "2019-08-29T07:52:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahere37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sahere37](https://discuss.elastic.co/u/sahere37)\
**Post date:** [August 29, 2019, 7:52am UTC](https://discuss.elastic.co/t/grokparsefailure-message-in-the-case-of-using-grok-filter/197275/1 "2019-08-29T07:52:10Z")

</div>

Hi all, i have some log as following template:

`1925/05/01;2019-07-23;00:00:55.193;[[ (MD) 19915478 CR=25895;AC=TLK;Id=2458`

I am using following filter in logstash script:

```
filter {
    csv {
        columns => ["ODate", "Date", "Time", "message"]
        separator => ";"
    }
if ("MD" and "CR" in [message]) {
	grok {
        match => { "message" => "\[\[%{SPACE}\(%{WORD:cn}\)%{SPACE}%{NUMBER:ID1}%{SPACE}CR=%{NUMBER:so};AC=%{WORD:Ac1};%{GREEDYDATA:other_message}"
		    }
			}
	}

```

when the logstash has been started leads to following result:

```
{
         "ODate" => "1925/05/01",
       "column6" => "Id=2458",
      "@version" => "1",
          "path" => "F:/1.log",
          "Time" => "00:01:48.130",
          "host" => "myhost",
    "@timestamp" => 2019-08-29T07:58:18.402Z,
       "message" => "[[ (MD) 19915478 CR=25895;AC=TLK;Id=2458",
       "column5" => "AC=TLK",
          "tags" => [
        [0] "_grokparsefailure"
    ],
          "Date" => "2019-07-23"
}

```

while I want it be as following:

```
{
         "ODate" => "1925/05/01",
       "other_message" => "Id=2458",
      "@version" => "1",
          "path" => "F:/1.log",
          "Time" => "00:01:48.130",
          "host" => "myhost",
    "@timestamp" => 2019-08-29T07:58:18.402Z,
       "message" => "[[ (MD) 19915478 CR=25895;AC=TLK;Id=2458",
       "Ac1" => "TLK",
       "cn" => "MD"
       "ID1" => "19915478"
       "so" => "25895"
          "Date" => "2019-07-23"
}

```

any advise will be so appreciated

---

<div class="post-metadata">

**Author:** ![sahere37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sahere37](https://discuss.elastic.co/u/sahere37)\
**Post date:** [August 29, 2019, 8:19am UTC](https://discuss.elastic.co/t/grokparsefailure-message-in-the-case-of-using-grok-filter/197275/2 "2019-08-29T08:19:22Z")

</div>

it has been solved. thanks

---

<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:** [September 26, 2019, 8:19am UTC](https://discuss.elastic.co/t/grokparsefailure-message-in-the-case-of-using-grok-filter/197275/3 "2019-09-26T08:19:28Z")

</div>

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