New EK install with Filebeat - 5.4 Stack


#1

I have installed Elasticsearch, Kibana and Filebeat along with x-Pack. This is all a 5.4 stack with basic license.
At this point it is a standalone install and enabled parsing secure, messages, audit.log, apache access and error logs plus mysqld log. Is there a working example of filebeat.yml to include the above logs parsed and displayed in the Kibana Discover as well as Visualization/Dashbaords? My goal is to setup a centralized log parsing solution which does all kinds of logs and implement monitoring/alerting. Below is the content of my filebeat.yml file. I am kind of new to this.

###################### 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:
    - /var/log/secure
    - /var/log/messages
    - /var/log/audit/audit.log
    - /var/log/broadworks/as1/*
    - /var/log/broadworks/as2/*
    #- c:\programdata\elasticsearch\logs\*

- input_type: log
  paths:
    - "/var/log/httpd/*"
  fields:
    apache: true
  fields_under_root: 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

  ### 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: ["localhost:9200"]

  # Optional protocol and basic auth credentials.
  protocol: "http"
  username: "elastic"
  password: "El@$t1c?"

#----------------------------- Logstash output --------------------------------
#output.logstash:
  # The Logstash hosts
  #hosts: ["localhost:5044"]

  # 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: ["*"]

(Tudor Golubenco) #2

For some of this stuff we have Filebeat modules which should make it really easy to parse and visualize them (they come with dashboards as well). See: https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-modules-overview.html

For log files that we don't have a module for, you need to use either Logstash or ES Ingest Node to parse them.


#3

I think your filebeat.yml is already enough to get these running.

you need to config dashboards section to import default dashboards, visualizations, searches etc.

either copy section from filebeat.full.yml or refer to detail document https://www.elastic.co/guide/en/beats/filebeat/current/configuration-dashboards.html

hope this can help you!


#4

I have used fiebeat.full.yml file to have most of the logs parsed using filebeat on the localhost. Our goal is to parse Broadsoft logs located under a specific directory which are of extension .txt and below is a snipper from one of the log files of this type. As you can see these log files are of the multiline type. Please advise on how these can be parsed.

2017.05.15 20:57:56:297 EDT | Info | Sip | Unknown | localHost68596:0

    udp 313 Bytes IN from 172.31.0.73:45609

SIP/2.0 200 OK
Via:SIP/2.0/UDP 172.31.0.70;branch=z9hG4bKBroadWorks.2uhv-172.31.0.73V5060-0-123828640-1900576324-1494896276288-
From:sip:expresslab.averistar.com;tag=1900576324-1494896276288-
To:sip:172.31.0.73
Call-ID:BW205756288150517-1587471597@172.31.0.70
CSeq:123828640 OPTIONS
Content-Length:0

2017.05.15 20:58:09:190 EDT | FieldDebug | CAP | CAP

    Incoming infoRequest CAP message parsed and processed. [Remote host:172.31.0.70]. Message:
<?xml version="1.0" encoding="UTF-8"?>0ac76d86f7ae5bdf87bd2d1e2988f1290g2q273@172.31.0.200
To: sip:ping@172.31.0.70
From: sip:ping@172.31.0.200;tag=da015b066a483cfec264d577fbafb8c90g2q273
Max-Forwards: 0
CSeq: 667086 OPTIONS

Also, after I updated the x-pack installation to basic license I am not getting the login prompt for kibana any more. Does the license update prevent kibana login prompt. For example: kibana is accessed using http://:5601
Please advise.


#5

Hello,

Dashboards were not a problem. My request was to parse the .txt type log files specific to Broadsoft which I mentioned in my earlier reply using filebeat to parse thes types of files and send to Elasticsearch. This is where I am stuck now with this project. I also mentioned not getting the login prompt when I access kibana which appear to have stopped after I updated the x-pack to basic license. Please advise.


(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.