in yaml use single quotes, not double quotes for your patterns
try pattern '^[[:space:]]*$' in case line has unspecified number of whitespace characters. This pattern should match all empty lines and all lines with any number of whitespace characters as in [\t\n\v\f\r ]
There is an empty line within an event, due to which multiline pattern is not considering the lines after the empty line. Subsequent lines after the empty line are considered as separate/different events. Any thoughts to consider this empty line also part of the multiline event.
Here is the sample log file snippet. You can see a BLANKLINE after line.separator = . So file.encoding = UTF-8 is considered as new event, instead of appending to the event it belongs to.
2017-04-07 01:44:27,684 INFO [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: JBoss EAP 7.0.0.GA (WildFly Core 2.1.2.Final-redhat-1) starting
2017-04-07 01:44:27,685 DEBUG [org.jboss.as.config] (MSC service thread 1-1) Configured system properties:
[Standalone] =
awt.toolkit = sun.awt.X11.XToolkit
line.separator =
[BLANK/EMPTY LINE]
file.encoding = UTF-8
Here is the filebeat configuration.
exclude_lines: '^[[:space:]]*$'
multiline.pattern: '^[[:space:]]+|^Caused by:'
multiline.negate: false
multiline.match: after
Let me know if any further information is required. Thanks for looking into this post.
I did try to format you post, but not sure formatting is correct. Please properly format logs using the </> button.
why you want file.encoding to be another event? This looks like some kind of structured log you can parse in Logstash/Elasticsearch Ingest Node. Other logs might include more fields...
Instead of matching on space, you might consider matching on timestamp/blank line and set multiline.negate: true.
file.encoding need not be another event. But here it is being considered by file beat as another event just because of the presence of BLANK/EMPTY line just before that.
I tried matching the timestamp line and set multiline.negate: true . Now I see all events are being appended and finally seeing only one document.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.