I have no idea how to only capture named grok patterns.
Here is my pipeline config:
rule “HourExtractor”
when
has_field(“TimeStamp”)
then
let Time = to_string($message.TimeStamp);
let Hour = grok(“%{DATA:UNWANTED}T%{NUMBER:Hour}%{DATA:UNWANTED}”, Time);
set_fields(Hour);
end
I have tried adding things such as: “, True” after “Time” and it won’t work at all, I’m sure it’s extremely simple, but I just can’t work it out and there aren’t many examples online.