Hello,
When parsing WAS System out logs, I want to check the EventType and replace the abbreviation with full Description.
like
EventType (Replace with) Full Description
"I" --> "Informational"
"F" --> "Fatal"
"D" --> "Detail"
"A" --> "Audit" etc..
I have the syntax something like this.. but not sure which is correct and very efficient for my conditional checks.
Syntax A
mutate{
gsub => ["EventType","I","Informational"]
gsub => ["EventType","F","Fatal"]
gsub => ["EventType","D","Detail"]
gsub => ["EventType","A","Audit"]
}
Syntax B
mutate{
if EventType == "I" {
gsub => ["EventType","I","Informational"]
}else if EventType == "F" {
gsub => ["EventType","F","Fatal"]
}else if EventType == "D" {
gsub => ["EventType","D","Detail"]
}else if EventType == "A" {
gsub => ["EventType","A","Audit"]
}
}
Which is correct ? or suggest me the correct and efficient systax.
Thanks in Advance.
Thanks
Fredrick