I am attempting to perform a gsub on a unicode character, and sub it out with something else. However, I'm having trouble matching it. The unicode character is \uFFFD (from http://www.ssec.wisc.edu/~tomw/java/unicode.html#x0000, the very last item on the page, specifically used as a replacement character). My logstash code to replace it looks like this:
ruby {
code => "
event.to_hash.each { |k,v|
v.gsub!('\uFFFD', 'replaceWithThis') if v.is_a?(String)
}
"
}
Which has worked for me for other replacements, but I can't seem to match the unicode character. I've also tried it with a double escape slash with no luck. Any ideas on how I could get this substitution to match??