# Grok pattern

**URL:** <https://discuss.elastic.co/t/grok-pattern/286575>\
**Category:** Logstash\
**Created:** [October 13, 2021, 6:40am UTC](https://discuss.elastic.co/t/grok-pattern/286575 "2021-10-13T06:40:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divya\_Bansal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divya_bansal/32/81564_2.png) [@Divya\_Bansal](https://discuss.elastic.co/u/Divya_Bansal)\
**Post date:** [October 13, 2021, 6:40am UTC](https://discuss.elastic.co/t/grok-pattern/286575/1 "2021-10-13T06:40:43Z")

</div>

I have to parse this log-  
05-10-21T13:17:20.457741775|lapideployment-547944bff7-4f2qr|1|iuser|20|0|25.090g|1.378g|68160|S|0.0|1.1|116:20.87|java|265

I am using pattern-%{TIMESTAMP\_ISO8601:timestamp}|%{DATA:pod}|

It is returning result as-  
{  
"timestamp": [  
[  
"05-10-21T13:17:20.457741775"  
]  
],  
"pod": [  
[  
null  
]  
]  
}

Can anyone help me with parsing this log?

---

<div class="post-metadata">

**Author:** ![Mustafa\_NAJIB](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mustafa_najib/32/95797_2.png) [@Mustafa\_NAJIB](https://discuss.elastic.co/u/Mustafa_NAJIB)\
**Post date:** [October 13, 2021, 8:50am UTC](https://discuss.elastic.co/t/grok-pattern/286575/2 "2021-10-13T08:50:40Z")

</div>

Hello,  
i think that you have to add \ before the "|"  
**this is your input data :**  
05-10-21T13:17:20.457741775|lapideployment-547944bff7-4f2qr|1|iuser|20|0|25.090g|1.378g|68160|S|0.0|1.1|116:20.87|java|265

this is the new filter / pattern :

```auto
 grok {
      match => {
        "message" => [
          "^%{TIMESTAMP_ISO8601:logdate}\|%{GREEDYDATA:pod}",
          "%{GREEDYDATA:FAILPARSE}"
        ]
      }
    }

```

Output :  
**"logdate": "05-10-21T13:17:20.457741775",**  
"message": "05-10-21T13:17:20.457741775|lapideployment-547944bff7-4f2qr|1|iuser|20|0|25.090g|1.378g|68160|S|0.0|1.1|116:20.87|java|265",  
**"pod": "lapideployment-547944bff7-4f2qr|1|iuser|20|0|25.090g|1.378g|68160|S|0.0|1.1|116:20.87|java|265"**

---

<div class="post-metadata">

**Author:** ![Divya\_Bansal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divya_bansal/32/81564_2.png) [@Divya\_Bansal](https://discuss.elastic.co/u/Divya_Bansal)\
**Post date:** [October 13, 2021, 8:54am UTC](https://discuss.elastic.co/t/grok-pattern/286575/3 "2021-10-13T08:54:36Z")

</div>

thank you so much, it worked

---

<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:** [November 10, 2021, 8:55am UTC](https://discuss.elastic.co/t/grok-pattern/286575/4 "2021-11-10T08:55:22Z")

</div>

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