I have two different kinds of messages that are very similar:
"Rec": " 10:33:38 +HCXPCTA-E CW83 ISMDAYS ASRA"}
"Rec": " 10:31:56 +HCXPCTA-E IS60 RX1 ISMDAYS ASRA"}
In the REC field one message has RX1
while the other is just 6 white spaces. (This text box doesn't allow for white space it seems, but the message w/o the rx1 has 6 white spaces. So both messages have the same number of characters).
How do I code something like "if white space ignore, else if not white space do: %{WORD:NAME}" ?
Here's what I have now that works only when there's white space, it fails if the RX1 exists:
grok { match => {"Rec" => " (?<Time_Stamp>[0-9][0-9]:[0-9][0-9]:[0-9][0-9]) +%{WORD:Message_Code}\-\E %{WORD:Tran_ID} %{WORD:Program} %{WORD:Abend_Code}"}}