Hello,
I am trying to extract a value from a log message that can take various forms, I have the 2 different regex patters which work individually.
if the first regex produces a certain field value I want to rewrite the field with a different regex pattern.
grok {
patterns_dir => ["./patterns"]
match => ["message", "%{GREEDYDATA}\n%{JAVA_EXCEPTION_SHORT:exception}"]
}
if [exception] =~ "Caused by" {
grok {
patterns_dir => ["./patterns"]
match => ["message", "%{GREEDYDATA}\n%{JAVA_EXCEPTION_LONG:exception}"]
}
the above line did not execute as expected, could somebody please suggest a possible solution?
Much appreciated in advance