Logstash - json filter removes backslash


(Francisca Lima) #1

Hello,
When I am doing a json filter in my logstash file, in fields where I have two backlashes ("\") one of them is removed. Why this is happening? Besides replacing \ to \, what can I do?

Thank you.


#2

Can you show an example of the json? Please indent it by 4 spaces, otherewise the backslashes will not display correctly.

Where are you seeing one of the backslashes has been removed?


(Francisca Lima) #3

In the original file I have "XYZ\\ABC", but when I use the json filter and inserting those data in elastic, I have "XYZ\ABC" (one backslash is lost). I tried to use: mutate { gsub => ["robotName","\","\\"]}
But, appears the error: Expected one of #, {, ,, ] at line...
How can I do to replace the backslash? Another way to use the gsub?


#4

Can you show the complete error message and configuration? The error message does tell you exactly where in the configuration the problem is.


(Francisca Lima) #5

When I insert the gsub, everything it was fine, but I save and run and some character appears in the gsub. I tried to delete but it appears again. I fixed using the gsub in ruby code. Thanks!


(system) closed #6

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