不好意思 忘记贴代码了
2018-07-24 17:08:53.125 [http-nio-80-exec-12] INFO [com.xxx.aop.RequestAspect:127] - 请求路径:/xxx_server/app/getBaseWeather,请求IP:180.110.251.197,请求方式:GET,执行方法:com.xxx.controller.AppController.getBaseWeather,执行时间:2,请求参数:[南京, , , 84d696651d39070b0cf8209ac2f515f8],返回数据:{"errCode":"","resCode":0,"resData":{"badFor":"种植","lowTemp":"28","temperature":"28","weather":"阴","humidity":"74%","accuRain":"638.6","goodFor":"施肥、打药","highTemp":"35","accuTemp":"2155.8"}}
需要截取这几个地方
目前已经实现 IP 和 路径的了 其他的实在没办法
2 个回复
rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk
赞同来自: chenxu_1993
zqc0512 - andy zhou
赞同来自:
需要添加几个字段 好像还有json解析
grok {
match => {
"message" => '%{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "%{WORD:verb} %{DATA:request} HTTP/%{NUMBER:httpversion}" %{NU
MBER:response:int} (?:-|%{NUMBER:bytes:int}) %{QS:referrer} %{QS:agent}'
}
}
json {
source => "返回数据"
id => "json_train"
}