Grok pattern/expression for "YYYY/MM/dd HH:mm:ss"

Hi,

Issue regarding grok patter. I need to create a grok pattern for following log. But I'm having problems with 2018/03/06 10:21:49 (YYYY/MM/dd HH:mm:ss) date format. Can anyone please help

Sample log:

INFO | jvm 1 | 2018/03/06 10:21:49 | 18/03/06 10:21:49 INFO SMPPSession: SMSMessage ...

Thanks in adavcne

Have you tried using the grok constructor web site?

Your date format is very close to that of most HTTP logs so you can draw inspiration from the HTTPDATE pattern:

3 Likes

YES. Tried with following and got succeeded.

(?<REQ_TIME>%{YEAR}/%{MONTHNUM}/%{MONTHDAY} %{TIME})

Many thanks for the support

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