Logstash在输出中显示奇怪的字符

时间:2019-04-10 06:23:09

标签: apache-kafka logstash apache-kafka-streams

从kafka流获取输出时,logstash还显示其他字符。 (\ u0018,\ u0000,\ u0002等)

我尝试将key_deserializer_class添加到logstash conf文件中,但这并没有太大帮助。

input {
        kafka {
                bootstrap_servers => "broker1-kafka.net:9092"
                topics => ["TOPIC"]
                group_id => "T-group"
                jaas_path => "/opt/kafka_2.11-1.1.0/config/kafka_client_jaas.conf"
                key_deserializer_class => "org.apache.kafka.common.serialization.ByteArrayDeserializer"
                sasl_mechanism => "SCRAM-SHA-256"
                security_protocol => "SASL_PLAINTEXT"
        }
}
output { stdout { codec => rubydebug } }

输出

{
    "@timestamp" => 2019-04-10T06:09:53.918Z,
       "message" => "(TOPIC\u0002U42019-04-10 06:09:47.01739142019-04-10T06:09:53.738000(00000021290065792800\u0002\u0004C1\u0000\u0000\u0002\u001EINC000014418569\u0002\u0010bppmUser\u0002����\v\u0000\u0002\u0010bppmUser\u0002֢��\v\u0002\u0002\u0002\u0002.\u0002\u0018;1000012627;\u0002<AGGAA5V0FEEW7APPOPCYPOR3RPPOLL\u0000\",
      "@version" => "1"
}

有什么方法可以在输出中不获取这些字符。

0 个答案:

没有答案