Search code examples
elasticsearchkibanalogstash-grokgrok

Grok pattern for Timestamp in the format YYYY/MM/DD HH:MM:SS


Need a grok patter to satisfy this format of timestamp YYYY/MM/DD HH:MM:SS sample : 2021/11/11 05:04:11


Solution

  • Used a custom pattern to define date as I could not find any pre-existing for this date.This works in ingest node pipeline present in Kibana UI

    %{MYPATTERN:datetime}%{SPACE}

    Definition of mypattern :

    {
     [1-9]{4}\/[0-9]{2}\/[0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2}
    }