Logstash doesn't start due to Charset issue

hi all
I installed logstash v. 6.6 on windows. my config file is as following:

input {
      beats {
        port => 5044
      }
    }
    output {

elasticsearch { 
    hosts => ["localhost:9200"]
	index => "my_log"

	}
	

	
	stdout { codec => rubydebug }

}

when i want to start logstash using cmd , it cannot be started due to following error. it is noted that, this config file is using in another logstash on another vm and works great. could you please advise me about this.

D:\Logstash\bin>logstash -f my_logstash.conf
Unable to get Charset 'sun.stdout.encoding', using default UTF-8
java.nio.charset.UnsupportedCharsetException: cp720
        at java.nio.charset.Charset.forName(Unknown Source)
        at org.apache.logging.log4j.util.PropertiesUtil.getCharsetProperty(PropertiesUtil.java:172)
        at org.apache.logging.log4j.core.appender.ConsoleAppender$Target.getCharset(ConsoleAppender.java:89)
        at org.apache.logging.log4j.core.appender.ConsoleAppender$Target$1.getDefaultCharset(ConsoleAppender.java:74)
        at org.apache.logging.log4j.core.appender.ConsoleAppender$Builder.build(ConsoleAppender.java:222)
        at org.apache.logging.log4j.core.appender.ConsoleAppender$Builder.build(ConsoleAppender.java:189)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:958)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:898)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:890)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:513)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:237)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:249)

Maybe this helps:

input {
  beats {
    port => 5044
    codec => json { charset => "UTF-8" }
  }  
}

Do you have any irregular characters in your data?

data is same for this vm and another one which logstash works great.

It is noted that, filebeat using following codec, but it is shipping logs to both VMs which one VM is ok but the other one faced to mentioned error

encoding: windows-1256

Dear defalt

the problem has been solved by adding following java options to jvm.options file of logstash:

-Dsun.stdout.encoding=UTF-8
-Dsun.stderr.encoding=UTF-8

Regards

1 Like

Great!
Please mark this as a solution so that others can find it easier :slight_smile:

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