Hallo,
i had a little Problem with processing Logmessages that contain some german umlauts.
But i found a solution how to handle umlauts (or anything which is not UTF-8 encoded)
When you check the logstash.log you might find something like this:
:message=>"Received an event that has a different character encoding than you configured.", :text=>"here is your message", :expected_charset=>"UTF-8",
Here is my solution:
input{
lumberjack{
port => 5043
ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt"
ssl_key => "/etc/pki/tls/private/logstash-forwarder.key"
codec => plain {charset => "CP1252" } # you can use another but this charset works perfectly for german
}
}
filter{
mutate{
gsub => [
# replace all german umlauts
# this is optional, logstash will convert the umlauts to the correct unicode codepoint
"message", "ä", "ae",
"message", "ö", "oe",
"message", "ü", "ue"
]
}
...
}
Logstash converts the Umlauts to the the correct unicode codepoints. You don't have to replace them, if you don't want to.
If you copy this in your logstash.conf via Windows (e.g. via Notepad++ and and winSCP) and you try to run it on a machine using a unix based OS, logstash might not start and write this message:
:message=>"Error: The following config files contains non-ascii characters but are not UTF-8 encoded ["/etc/logstash/central.conf"]"
In this case, use vim or nano directly on your unix-machine to insert this.
Kind regards
Rolf