[英]How to create grok filter for logstash conf
亲爱的社区成员,
我是grok的新手。 以下是我想要提取字段值的日志消息:
Method : createCabinet
Argument : {"comments":....}
Result : <201 Created,Folder ....
Time : 21611 msec
CorrelationId : 00905cda-10a0-4793-8b77-e1dba05dcb2c
日志消息:
16:43:45.159 [http-nio-8183-exec-9] INFO com.newgen.aspect.LoggingAspect - 方法:createCabinet | 参数:{“comments”:“由系统预先创建的默认机柜”,“ownerName”:“manoj”,“usedFor”:“general”,“folderName”:“Cabinet80704183”,“ownerId”:“AVlFxAVOoeDBAMtAMzee”,“folderType” :“cabinet”} {“bytes”:[49,50,51,52,53],“empty”:false} | 结果:<201已创建,文件夹[id = 5cac7e618dd9854e78007736,folderName = Cabinet80704183,folderType = cabinet,comments =由系统预先创建的默认文件柜,parentFolderId = null,ownerName = manoj,ownerId = AVlFxAVOoeDBAMtAMzee,creationDateTime = Tue Apr 09 16:43:34 IST 2019,revisedDateTime = null,accessDateTime = null,usedFor = general,version = 0,metadataId = null,tenantId = 12345],{}> | 时间:21611毫秒| CorrelationId:00905cda-10a0-4793-8b77-e1dba05dcb2c
我正在调试这个https://grokdebug.herokuapp.com到目前为止无法为logstash构建所需的grok过滤器。 感谢您对此的帮助。
谢谢,
尝试这个:
%{TIME:timestamp} \[%{NOTSPACE}\] %{NOTSPACE:log_level} %{NOTSPACE:class} \- Method \: %{NOTSPACE:method} \| Argument \: %{GREEDYDATA:argument} \| Result \: %{GREEDYDATA:result} \| Time \: %{NUMBER:time_ms} msec \| CorrelationId \: %{NOTSPACE:correlation_id}
在Logstash 6.7上测试
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.