Received an event that has a different character encoding than you configured. Log4j2 to Logstash

I am trying to get spark logs to logstash with custom log4j2 properties. My log4j2 properties file

#Define the log4j configuration for local application
#log4j.rootLogger=INFO, server

#We will use socket appender

#Port where socket server will be listening for the log events


#Defining the layout
log4j.appender.server.layout.conversionPattern=${} [%d] %p %m (%c)%n

#Host name or IP address of socket server

#Define any connection delay before attempting to reconnect

Logstash configuration file

input {
  tcp {
    port => 5044
         codec => plain {
               charset => "UTF-8"
output {
  stdout { codec => rubydebug }

I am getting from logstash stdout

 "port" => 37438,
    "@timestamp" => 2021-06-15T06:44:57.495Z,
          "host" => "slave1",
       "message" => "threadNameq\u0000~\u0000\u0001L\u0000\rthrowableInfot\u0000+Lorg/apache/log4j/spi/ThrowableInformation;xp\u0000\u0000\u0000\u0000\u0001z\u000EjzIt\\u00006Creating new connection to slave2/\u0000\u0016netty-rpc-connection-0pw\u0004\u0000\u0000'\u0010pxy",
      "@version" => "1"

As in here there are some decoding issue . Appreciate your help .

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