Gsub filter not working as expected for dot to underscore conversion

Hi All,

I have been trying to replace dots to underscores in the fieldname using gsub filter and didnt succeeded,
here is my filter

mutate {
    gsub => [
        "caller_id.location.latitude", ".", "_"
        ]
}

there are no errors while executing logstash, but there is no change in the fieldname when i check the output in rubydebug.

Is there something i'm missing or gsub doesnot support this type of conversion, please advice.

Thanks
Gauti

The second string "." is converted to a regex so you will need to escape the dot.

@guyboertje how do i escape that dot? any idea??

Thanks
Gauti

Well you could google it

It is "\."

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.