Syntax for grok mutate gsub to replace double quotes with single quotes

Help is needed

What is the syntax for using "grok mutate gsub" to replace double quotes with single quotes when using logstash.

Thank,

+4
source share
3 answers

Do you want this? The mutate filter will change the entire double quote to a single quote.

filter {    
    mutate {
        gsub => ["message","\"","'"]
    }
}
+8
source

It works:

   mutate {
        gsub => ['message','\"','`']
    }

For some reason, escaping for a single quote (to replace double quotes) does not work, so it is used `as a compromise

0
source

gsub. . :

filter {    
    mutate {
        gsub => ['message','"',"'"]
    }
}
0

Source: https://habr.com/ru/post/1532665/


All Articles