I am working on a requirement where, I have to capture the multi line log messages, sending them via logstach and view them on Kibana. I am trying with version 5.1 and 5.3 versions of filebeat.
In 5.1, with the pattern matching, I am getting the result as expected and all the multi line and single line messages are aggregated and i can see them in Kibana. No issues and no line are missed.
In 5.3, with the pattern matching, If the log is ending with a multi line, except that, every line is capured as expected. When I add another line with matching pattern, the last mutli line message is now capturing.
Also irrespective of the pattern matching, every time the last time is getting missed. Is this an expected behaviour?
The nagate pattern I am using is negate: true and match: after ( in 5.1) multiline.negate: true and multiline.match: after (in 5.3)
07 Mar 2017 "GET 1 /mailman/listinfo/business HTTP/1.1" 200 6379
07 Mar 2017 "GET 2 /twiki/bin/rdiff/Main/WebIndex?rev1=1.2&rev2=1.1 HTTP/1.1" 200 46373
07 Mar 2017 "GET 3 /twiki/bin/view/Main/MikeMannix HTTP/1.1" 200 3686
07 Mar 2017 "GET 4 /twiki/bin/attach/Main/PostfixCommands HTTP/1.1" 401 12846
dfsdfsdf
sdfsadf
asdfsd
sdfasdf
07 Mar 2017 "GET 5 /twiki/bin/view/Main/TokyoOffice HTTP/1.1" 200 3853
fasdfaksdjf
sdfksdf
sdfkjsdfk
07 Mar 2017 "GET 6 /twiki/bin/view/TWiki/DontNotify HTTP/1.1" 200 4140
sdljfklwe
iewuorwe032
o320
07 Mar 2017 "Venu Test" 7
Configuration:
###################### Filebeat Configuration Example #########################
# This file is an example configuration file highlighting only the most common
# options. The filebeat.full.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html
#=========================== Filebeat prospectors =============================
filebeat.prospectors:
# Each - is a prospector. Most options can be set at the prospector level, so
# you can use different prospectors for various configurations.
# Below are the prospector specific configurations.
- input_type: log
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /tmp/abc.log
#- c:\programdata\elasticsearch\logs\*
# Exclude lines. A list of regular expressions to match. It drops the lines that are
# matching any regular expression from the list.
#exclude_lines: ['\sDEBUG','\sINFO']
# Include lines. A list of regular expressions to match. It exports the lines that are
# matching any regular expression from the list.
#include_lines: ['\sERROR']
# Exclude files. A list of regular expressions to match. Filebeat drops the files that
# are matching any regular expression from the list. By default, no files are dropped.
#exclude_files: [".gz$"]
# Optional additional fields. These field can be freely picked
# to add additional information to the crawled log files for filtering
#fields:
# level: debug
# review: 1
### Multiline options
# Mutiline can be used for log messages spanning multiple lines. This is common
# for Java Stack Traces or C-Line Continuation
# The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
multiline.pattern: ^\d{2}\s\w{3}\s\d{4}\s"
# Defines if the pattern set under pattern should be negated or not. Default is false.
multiline.negate: true
# Match can be set to "after" or "before". It is used to define if lines should be append to a pattern
# that was (not) matched before or after or as long as a pattern is not matched based on negate.
# Note: After is the equivalent to previous and before is the equivalent to to next in Logstash
multiline.match: after
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.