推荐 最新
北北che

helm3安装了logstash配置好了logback,但是日志记录一直不对,如何解决?

logstash配置: global: storageClass: alibabacloud-cnfs-nas service: type: NodePort ports: - name: http port: 8080 targetPort: http protocol: TCP - name: syslog-udp port: 1514 targetPort: syslog-udp protocol: UDP - name: syslog-tcp port: 1514 targetPort: syslog-tcp protocol: TCP persistence: # 云盘 # storageClass: "alicloud-disk-ssd" # size: 20Gi # NAS storageClass: alibabacloud-cnfs-nas size: 2Gi input: |- udp { port => 1514 codec => json_lines } tcp { port => 1514 codec => json_lines } http { port => 8080 } filter: |- json { source => "message" target => "json" } output: |- if [env] != "" { elasticsearch { hosts => ["xxx.xxx.xxx.xxx:xxxx"] index => "logs33--success-%{+YYYY.MM.dd}" } } else { elasticsearch { hosts => ["xxx.xxx.xxx.xxx:xxxx"] index => "logs-failure-%{+YYYY.MM.dd}" } } stdout { codec => rubydebug } logback配置 --> xxx.xxx.xxx.xxx:xxx {"env":"dev"} UTC { "serviceName": "${name}", "level": "%level", "message": "%message", "env": "test", "stack_trace": "%exception{5}", "pid": "${PID:-}", "thread": "%thread", "class": "%logger{40}" } ERROR>WARN>INFO>DEBUG>TRACE>ALL --> --> INFO--> --> logstash打印的日志: [2023-09-22T02:26:50,029][INFO ][logstash.codecs.json ][main][f3916e23ca79e9308acd3be143501936b256d568e41e841a6fd83f731839d2c0] ECS compatibility is enabled but `target` option was not specified. This may cause fields to be set at the top-level of the event where they are likely to clash with the Elastic Common Schema. It is recommended to set the `target` option to avoid potential schema conflicts (if your data is ECS compliant or non-conflicting, feel free to ignore this message) { "event" => { "original" => "" }, "json" => nil, "message" => "", "host" => { "ip" => "10.0.125.0" }, "url" => { "path" => "/bad-request" }, "http" => { "version" => "HTTP/1.0", "method" => "GET" }, "@timestamp" => 2023-09-22T02:26:50.030993835Z, "@version" => "1" } 从打印的日志看,输出的格式明显有问题。

13
1
0
浏览量355