Filebeat Issue - all log entries are merged in a single message instead of multiple messages

Thanks MarianaD for your response.

In my case, I doubt if I need to apply multiline as each log entry is recorded in separate line instead of spreading one log entry in multiple lines. However, I applied the same as suggested, but still can see same issue. Please find the below samples & advise how to fix this issue. Appreciate your quick help here.

Filebeat.yml
##################### 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
    enabled: true

    Paths that should be crawled and fetched. Glob based paths.

    paths:
    - /opt/stash/data/log/sample-filebeat-log.log

    scan_frequency: 15s

    clean_inactive: true

    clean_removed: true

    Exclude lines. A list of regular expressions to match. It drops the lines that are

    matching any regular expression from the list.

    #exclude_lines: ["^DBG"]

    Include lines. A list of regular expressions to match. It exports the lines that are

    matching any regular expression from the list.

    #include_lines: ["^ERR", "^WARN"]

    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

    environment: dev
    hosting_env: citi
    log_type: varlog

    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: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'

    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

#================================ General =====================================

The name of the shipper that publishes the network data. It can be used to group

all the transactions sent by a single shipper in the web interface.

#name:

The tags of the shipper are included in their own field with each

transaction published.

#tags: ["service-X", "web-tier"]

Optional fields that you can specify to add additional information to the

output.

#fields:

env: staging

#================================ Outputs =====================================

Configure what outputs to use when sending the data collected by the beat.

Multiple outputs may be used.

#-------------------------- Elasticsearch output ------------------------------

output.elasticsearch:

Array of hosts to connect to.

hosts: ["sd-3fbe-d57e.nam.nsroot.net:9200"]

Optional protocol and basic auth credentials.

#protocol: "https"
#username: "elastic"
#password: "changeme"

#----------------------------- Logstash output --------------------------------
output.logstash:

The Logstash hosts

hosts: ["sd-3fbe-d57e.nam.nsroot.net:5044"]

loadbalance: true

Optional SSL. By default is off.

List of root certificates for HTTPS server verifications

#ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

Certificate for SSL client authentication

#ssl.certificate: "/etc/pki/client/cert.pem"

Client Certificate Key

#ssl.key: "/etc/pki/client/cert.key"

#================================ Logging =====================================

Sets log level. The default log level is info.

Available log levels are: critical, error, warning, info, debug

logging.level: debug

At debug level, you can selectively enable logging only for some components.

To enable all selectors use ["*"]. Examples of other selectors are "beat",

"publish", "service".

logging.selectors: ["*"]

logging.to_files: true
logging.to_syslog: false
logging.files.path: /var/log/filebeat
logging.files.name: bbdemo.log
logging.files.keepfiles: 2
registry_file: /etc/filebeat/.filebeat.registry

Sample Log File
127.0.0.1 | ssh | 8727584@bdhfjd | us12345 | 2019-06-04 05:00:31,211 | SSH - git-upload-pack '/sample/test2.git' | "SSH-2.0-JSCH-0.1.51" | - | - | - | - | - | 01bqdss |
127.0.0.1 | ssh | bvy090@bdhfjd | ma12345 | 2019-06-04 05:00:31,243 | SSH - git-upload-pack '/sample/test1.git' | "SSH-2.0-JSCH-0.1.51" | 1 | 0 | 0 | ssh:user:id:007 | 32 | 02bqdss |
127.0.0.1 | https | x@hjdf895ko | - | 2019-06-04 05:00:40,879 | "GET /status HTTP/1.0" | "" "" | - | - | - | - | - | - |
127.0.0.1 | https | b@hjdfg89845k | - | 2019-06-04 05:00:40,880 | "GET /status HTTP/1.0" | "" "" | 200 | 0 | 19 | - | 1 | - |
127.0.0.1 | https | myu@abh387fhg | - | 2019-05-27 19:07:31,787 | "GET /rest/api/sample/test1/pull-requests HTTP/1.1" | "https://demo.com:8446/sample/test" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36" | - | - | - | - | - | 23hghe4 |
127.0.0.1 | ssh | yu@1WZertk | xy94583 | 2019-05-28 19:07:31,268 | SSH - git-upload-pack '/sample/test3.git' | "SSH-2.0-JSCH-0.1.51" | - | - | - | - | - | 89p8kh |
127.0.0.1 | https | 12k@x0 | - | 2019-05-29 19:07:16,293 | "GET /status HTTP/1.0" | "" "" | 200 | 0 | 19 | - | 1 | - |
127.0.0.1 | ssh | k@1gue23 | ts97159 | 2019-05-30 14:09:44,885 | SSH - git-upload-pack '/sample/test4.git' | "SSH-2.0-JSCH-0.1.51" | 1 | 0 | 0 | ssh:user:id:008 | 009 | 1234mw56 |

Kibana Output