Apache nifi 如何在ApacheNifi中使用ExtractGrok处理器获取多行?
我将把日志文件events(由Apache nifi 如何在ApacheNifi中使用ExtractGrok处理器获取多行?,apache-nifi,logstash-grok,grok,Apache Nifi,Logstash Grok,Grok,我将把日志文件events(由LogAttributeprocessor记录)转换为JSON 我将“ExtractGroke”用于此配置: 模式文件中的堆栈模式是(?m)。* 每个日志都有以下格式: 2019-11-21 15:26:06,912 INFO [Timer-Driven Process Thread-4] org.apache.nifi.processors.standard.LogAttribute LogAttribute[id=143515f8-1f1d-1032-e7d2
LogAttribute
processor记录)转换为JSON
我将“ExtractGroke”用于此配置:
模式文件中的堆栈模式是(?m)。*
每个日志都有以下格式:
2019-11-21 15:26:06,912 INFO [Timer-Driven Process Thread-4] org.apache.nifi.processors.standard.LogAttribute LogAttribute[id=143515f8-1f1d-1032-e7d2-8c07f50d1c5a] logging for flow file StandardFlowFileRecord[uuid=02eb9f21-4587-458b-8cee-ad052cb8e634,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1574339166853-1, container=default, section=1], offset=0, length=0],offset=0,name=0df20cc1-3f93-49df-81b1-dac18318ccd9,size=0]
------------- request was received----------
Standard FlowFile Attributes
Key: 'entryDate'
Value: 'Thu Nov 21 15:26:06 AST 2019'
Key: 'lineageStartDate'
Value: 'Thu Nov 21 15:26:06 AST 2019'
Key: 'fileSize'
Value: '0'
FlowFile Attribute Map Content
Key: 'filename'
Value: '0df20cc1-3f93-49df-81b1-dac18318ccd9'
Key: 'http.context.identifier'
Value: '9552bd22-ec3b-4ada-93a9-a5ce9b27de25'
Key: 'path'
Value: './'
Key: 'uuid'
Value: '02eb9f21-4587-458b-8cee-ad052cb8e634'
-------------- request was received----------
在日志中保存第一行之后,我期望消息的其余部分,但我只收到第一行请求------------
我签入表达式,它就工作了。但它对NiFi不起作用
如何配置ExtractGrok以获取日志值中的所有行?我找到了解决方案,我将
(?m)。*
替换为这一个(?s)。*
并且它可以工作