I want to match a text and replace it with matched value using gsub regex. we ususally do it using $1 which is regex backward reference.
the below code contain my requirement
filter {
mutate {
gsub => [
# replace all forward slashes with underscore
"fieldname", "/", "_$1",
# replace backslashes, question marks, hashes, and minuses
# with a dot "."
"fieldname2", "a", "$2bc"
]
}
}
thanks for reading and helping.