replacing backslashes
Posted: Fri Aug 19, 2016 4:10 am
Hi, I have following stuff in a field:
"field_A" => "c:\\test\\test.txt"
rubydebug shows it as "c:\\\\test\\\\test.txt"
By some conversion the masking backslash became a valid character.
How can I get rid of the double backslashes, so that I have only one (or two when masked)?
I tried:
but that is not accepted by logstash.
If I try to replace to '[\\]' then the brackets are also inserted.
Any idea?
Thanks a lot.
"field_A" => "c:\\test\\test.txt"
rubydebug shows it as "c:\\\\test\\\\test.txt"
By some conversion the masking backslash became a valid character.
How can I get rid of the double backslashes, so that I have only one (or two when masked)?
I tried:
Code: Select all
mutate
{
gsub =>
[
'field_A', '(\\\\)', '\\'
]
}
If I try to replace to '[\\]' then the brackets are also inserted.
Any idea?
Thanks a lot.