0

I have the following I'm trying to parse with GROK:

Hello|STATSTIME=20-AUG-15 12.20.03.051000 PM|World

I can parse the first bunch of it with GROK like so:

match => ["message","%{WORD:FW}\|STATSTIME=%{MONTHDAY:MDAY}-%{WORD:MON}-%{INT:YY} %{INT:HH}"]

Anything further than that gives me an error. I can't figure out how to quote the : character, : does not work and %{TIME:time} does not work. I'd like to be able to get the whole thing as a timestamp, but can't get it broken up. Any ideas?

mikeb
  • 10,578
  • 7
  • 62
  • 120

1 Answers1

0

You can use this to debug grok expressions

The time format is as shown here

To parse 12.20.03.051000

%{INT:hour}.%{INT:min}.%{INT:sec}.%{INT:ms}

Output will be something like this

{
"hour": [
      [
      "12"
      ]
 ],
"min": [
     [
      "20"
     ]
 ],
"sec": [
    [
     "03"
    ]
],
"ms": [
    [
   "051000"
    ]
 ]
}