nginx日志中有\x09\x09\x09这种字符串,导致logstash不能收集,有没有人遇到过并解决了的?
nginx日志中有x09x09x09Version/这种字符串,导致logstash收集过滤的时候报错,有没有人遇到过同样的问题并解决的。
nginx日志内容:
{"http_host": "xxxx", "@timestamp": "2018-07-05T13:54:24+08:00", "remote_addr": "10.0.0.23", "remote_user": "-", "request": "GET /article/index.html HTTP/1.1", "status": "200", "body_bytes_sent": "1166", "http_referrer": "-", "http_user_agent": "Mozilla/5.0 (Linux; Android 5.1.1; SM801 Build/LMY47V; wv) AppleWebKit/537.36 (KHTML, like Gecko) \x09\x09\x09Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043015 Safari/537.36 V1_AND_SQ_6.6.9_482_YYB_D QQ/6.6.9.3060 NetType/2G WebP/0.3.0 Pixel/1080", "http_x_forwarded_for": "61.151.226.65, 10.255.0.3", "request_time": "0.000", "upstream_response_time": "-"}
logstash报错日志:
[2018-07-05T13:54:26,216][WARN ][logstash.filters.json ] Error parsing json {:source=>"message", :raw=>"{\"http_host\": \"xxxxx\", \"@timestamp\": \"2018-
07-05T13:54:24+08:00\", \"remote_addr\": \"10.0.0.23\", \"remote_user\": \"-\", \"request\": \"GET /article/index.htmlHTTP/1.1\", \"status\": \"200\", \"body_bytes_sent\": \"1166\", \"http_referrer\": \"-\", \"http_user_agent\": \"Mozilla/5.0 (Linux; Android 5.1.1; SM801 Build/LM
Y47V; wv) AppleWebKit/537.36 (KHTML, like Gecko) \\x09\\x09\\x09Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043015 Safari/537.36 V1_AND_SQ_6.6.9_482_YYB_
D QQ/6.6.9.3060 NetType/2G WebP/0.3.0 Pixel/1080\", \"http_x_forwarded_for\": \"61.151.226.65, 10.255.0.3\", \"request_time\": \"0.000\", \"upstream_response_time\": \
"-\"} ", :exception=>#<LogStash::Json::ParserError: Unrecognized character escape 'x' (code 120)
at [Source: (byte[])"{"http_host": "xxxxx", "@timestamp": "2018-07-05T13:54:24+08:00", "remote_addr": "10.0.0.23", "remote_user": "-", "request": "GET /arti
cle/index.htmlHTTP/1.1", "status": "200", "body_bytes_sent": "1166", "http_referrer": "-", "http_user_agent": "Mo
zilla/5.0 (Linux; Android 5.1.1; SM801 Build/LMY47V; wv) AppleWebKit/537.36 (KHTML, like Gecko) \x09\x09\x09Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/0
43015 Safari/537.36 V"[truncated 183 bytes]; line: 1, column: 411]>}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
参考http://qaru.site/questions/12...
分别给出了logstash 5版本之前和版本之后的解决方法