次のように、単一のファイルから入力を取得する filebeat.yml で Filebeat の複数行パターンを使用しています。
2016-10-06 14:36:00.419 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : requestStartIdentifier: Identifier
2016-10-06 14:36:00.419 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : requestUri:
2016-10-06 14:36:00.420 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : HttpServletRequest:
ContentType: text/xml; charset=utf-8
ContextPath:
LocalAddr:
LocalName:
PathInfo:
PathTranslated:
QueryString:
RequestURI:
RequestURL:
RemoteHost:
ServletPath:
Header: Host:
Header: Content-Length:
Header: Accept-Encoding:
Header: SOAPAction: ""
Header: User-Agent: Apache-HttpClient/4.2.1
Header: Content-Type: text/xml; charset=utf-8
Header: Connection: Keep-Alive
Header: Accept: text/xml
2016-10-06 14:36:00.420 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : uri: , request:
<env:Envelope></env:Envelope>
2016-10-06 14:36:00.419 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : requestStartIdentifier: Identifier
2016-10-06 14:36:00.419 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : requestUri:
2016-10-06 14:36:00.420 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : HttpServletRequest:
ContentType: text/xml; charset=utf-8
ContextPath:
LocalAddr:
LocalName:
PathInfo:
PathTranslated:
QueryString:
RequestURI:
RequestURL:
RemoteHost:
ServletPath:
Header: Host:
Header: Content-Length:
Header: Accept-Encoding:
Header: SOAPAction: ""
Header: User-Agent: Apache-HttpClient/4.2.1
Header: Content-Type: text/xml; charset=utf-8
Header: Connection: Keep-Alive
Header: Accept: text/xml
2016-10-06 14:36:00.420 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : uri: , request:
<env:Envelope></env:Envelope>
ファイルビート.yml
multiline:
pattern: Identifier
negate: true
match: after
上記の構成を使用して、行の「識別子」を一致させます。出力は希望どおりにする必要があります
event -1 :
2016-10-06 14:36:00.419 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : requestStartIdentifier: Identifier
2016-10-06 14:36:00.419 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : requestUri:
2016-10-06 14:36:00.420 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : HttpServletRequest:
ContentType: text/xml; charset=utf-8
ContextPath:
LocalAddr:
LocalName:
PathInfo:
PathTranslated:
QueryString:
RequestURI:
RequestURL:
RemoteHost:
ServletPath:
Header: Host:
Header: Content-Length:
Header: Accept-Encoding:
Header: SOAPAction: ""
Header: User-Agent: Apache-HttpClient/4.2.1
Header: Content-Type: text/xml; charset=utf-8
Header: Connection: Keep-Alive
Header: Accept: text/xml
2016-10-06 14:36:00.420 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : uri: , request:
<env:Envelope></env:Envelope>
event -2 :
2016-10-06 14:36:00.419 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : requestStartIdentifier: Identifier
2016-10-06 14:36:00.419 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : requestUri:
2016-10-06 14:36:00.420 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : HttpServletRequest:
ContentType: text/xml; charset=utf-8
ContextPath:
LocalAddr:
LocalName:
PathInfo:
PathTranslated:
QueryString:
RequestURI:
RequestURL:
RemoteHost:
ServletPath:
Header: Host:
Header: Content-Length:
Header: Accept-Encoding:
Header: SOAPAction: ""
Header: User-Agent: Apache-HttpClient/4.2.1
Header: Content-Type: text/xml; charset=utf-8
Header: Connection: Keep-Alive
Header: Accept: text/xml
2016-10-06 14:36:00.420 DEBUG 29695 --- [XNIO-2 task-2] c.a.a.s.endpoint.endone.server : uri: , request:
<env:Envelope></env:Envelope>