Filebeat 5.0 - Logstash 5.0 communication issue on Windows Server 2012 R2

Hi there,

I think I've tried every combination I can think of over the past days and am at my wits end. So any hints / tips will be greatly appreciated.

Environment:

  • The whole stack is installed on a single machine (just for testing purposes) which runs Windows Server 2012 R2
  • I'm using Kibana, Elasticsearch, Logstash and Filebeats; all of them are version 5.0.0

I have managed to get the following combinations to work Kibana, Elasticsearch, Logstash & Kibana, Elasticsearch, Filebeat. However I am hitting a brick wall when trying the combination Kibana, Elasticsearch, Logstash and Filebeats. I've nailed down the issue to be something to do with Filebeat & Logstash.

Note: For the sake of debugging this issue, I've removed my Logstash to Elasticsearch mapping. I've listed below the contents of my filebeat and logstash configuration files. Filebeats will be looking at a local logs folder on the D:\ drive and push that up to Logstash via port 5043. I've tried telnet to 127.0.01 5043 and that works too. I've also verified that both config files have got the right settings in expected format.

Filebeat Configuration Settings
###################### 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:
    - D:\logs\*
    #- 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: ["^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: ^\[

  # Defines if the pattern set under pattern should be negated or not. Default is false.
  #multiline.negate: false

  # 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: "https"
  #username: "elastic"
  #password: "changeme"

#----------------------------- Logstash output --------------------------------
#output.logstash:
  # The Logstash hosts
  hosts: ["127.0.0.1:5043"]

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

Logstash Configuration Settings
input {
beats {
port => "5043"
}
}
filter {
grok {
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{NOTSPACE:sitename} %{NOTSPACE:computername} %{IPORHOST:internalIP} %{WORD:verb} %{URIPATH:uri} %{NOTSPACE:arr} %{NUMBER:port:int} - %{IPORHOST:externalIP} %{NOTSPACE:httpVersion} %{NOTSPACE:userAgent} %{NOTSPACE:cookies} - %{NOTSPACE:referredDomain} %{NUMBER:statusCode:int} %{NUMBER:subStatus:int} %{NUMBER:win32Status:int} %{NUMBER:bytesIn:int} %{NUMBER:bytesOut:int} %{NUMBER:timeTaken:int}"
}
}
geoip {
source => "externalIP"
}
}
output {
stdout { codec => rubydebug }
}

However I see errors in both Filebeat and Logstash.

Filebeat Log Entry
ERR Connecting error publishing events (retrying): Get http://127.0.0.1:5043: EOF

Logstash Log Entry
[ERROR][org.logstash.beats.BeatsHandler] Exception: org.logstash.beats.BeatsParser$InvalidFrameProtocolException: Invalid Frame Type, received: 69

What am I doing wrong over here?

Hi All,

I posted this plea for help after whittling down one issue after the other. And managed to resolve it thanks to the what this question got formatted on the site.

My mistake was in filebeat.yml setting. Though I had uncommented the logstash host I had not done it fully. The correct setting is listed below. Keen eyes unlike my tired ones will notice the differences
#output.elasticsearch:
# Array of hosts to connect to.
#hosts: ["localhost:9200"]
output.logstash:
# The Logstash hosts
hosts: ["127.0.0.1:5043"]

Hope this helps someone. Sorry for clogging up the space.

2 Likes

Thanks for sharing your solution!

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