Hi,
Message: /merlion/dpa2/cn133ta/j4_sryuo/j4_02_sv_ip
I am trying to find a way to remove the strings BEFORE and AFTER a defined string in a message.
In this message, the constant value is dpa2, and I want to discard anything BEFORE dpa2(inclusive), and the "cn133ta/". Only want to retain "j4_sryuo/j4_02_sv_ip".
The position of cn133ta will be of dynamic value, so it is not a constant string. Hope that makes sense.
At the moment, I have tried the gsub below:
mutate { gsub => [ "dir_path", "/[^./]+/tpa2/", "/" ] }
But I'm having trouble finding a way to discard the AFTER string, in this case "cn133ta/".
Thanks