Hi Bagder,
I gave this example to make it easier to understand but the focus is use this regexp in if conditional.
if I do your suggest, gsub will modify my "some_field" and i dont want it.
I need to use this regexp in "if condicional" to use gsub to modify another field.
Like (this "if" does not work ) :
if [m3ua.message_class] =~ /(^1$|^1,.*|*.,1,.*|*.,1$)/ {
mutate {
gsub => [
"m3ua.message_type", "^1$", "DUNA_destination_unavailable_1",
"m3ua.message_type", "^1,", "DUNA_destination_unavailable_1,",
"m3ua.message_type", ",1,", ",DUNA_destination_unavailable_1,",
"m3ua.message_type", ",1$", ",DUNA_destination_unavailable_1",
"m3ua.message_type", "^2$", "DAVA_destination_available_2",
"m3ua.message_type", "^2,", "DAVA_destination_available_2,",
"m3ua.message_type", ",2,", ",DAVA_destination_available_2,",
"m3ua.message_type", ",2$", ",DAVA_destination_available_2",
"m3ua.message_type", "^3$", "DAUD_Destination_state_audit_3",
"m3ua.message_type", "^3,", "DAUD_Destination_state_audit_3,",
"m3ua.message_type", ",3,", ",DAUD_Destination_state_audit_3,",
"m3ua.message_type", ",3$", ",DAUD_Destination_state_audit_3",
"m3ua.message_type", "^4$", "SCON_SS7_signalling_congestion_state_4",
"m3ua.message_type", "^4,", "SCON_SS7_signalling_congestion_state_4,",
"m3ua.message_type", ",4,", ",SCON_SS7_signalling_congestion_state_4,",
"m3ua.message_type", ",4$", ",SCON_SS7_signalling_congestion_state_4"
]
}
}