Logstash collects Chinese garbled codes
R & D feedback graylog log shows garbled code (as shown below). The first reaction is that it is caused by the character set.
Check the system environment character set
[root@apiVM-007 ~] # locale
LANG=zh_CN.GB18030
LC_CTYPE= "zh_CN.GB18030"
LC_NUMERIC= "zh_CN.GB18030"
LC_TIME= "zh_CN.GB18030"
LC_COLLATE= "zh_CN.GB18030"
LC_MONETARY= "zh_CN.GB18030"
LC_MESSAGES= "zh_CN.GB18030"
LC_PAPER= "zh_CN.GB18030"
LC_NAME= "zh_CN.GB18030"
LC_ADDRESS= "zh_CN.GB18030"
LC_TELEPHONE= "zh_CN.GB18030"
LC_MEASUREMENT= "zh_CN.GB18030"
LC_IDENTIFICATION= "zh_CN.GB18030"
LC_ALL=
View log file encoding format
Check the logstash manual and find that it is configurable, public codec plug-in character set
Https://www.elastic.co/guide/en/logstash/5.6/plugins-codecs-multiline.html
Modify the configuration as follows, restart logstash, and solve the problem.