我收到没有任何解析的日志:
source s_network {
network( transport(tcp) port(601) flags(no-parse));
};
我保存的日志有两部分:
- 接收者信息
- 日志的 json 部分(如下所示):
Feb 18 00:01:58 82.172.112.1 <40> 2020-02-17T20:29:49Z logserver-2 : {"method":"GET","scheme":"https","domain":"test.com","uri":"/App_Themes/font.woff","referer":"https://test.com/","ip":"31.135.115.92","ua":"Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Mobile/15E148 Safari/604.1","content_type":"text/html","status":404,"server_port":443,"bytes_sent":1222,"bytes_received":1245,"upstream_time":0.016}
我的问题是:
如何分离 json 部分(删除文本的第一部分)?
如何根据 json 数据生成文件名?例如我想保存get method
在单独的文件中。