Logstash is not reading the data from the filebeats

I am trying to load the data into logstash which is read by the file beat, but logstash is unable to read the data.

Here are my filebeat debug data that are being generated while running it.
2020-06-11T13:01:41.607+0530 DEBUG [input] log/input.go:511 Update existing file for harvesting: C:\Users\tushar\Documents\logs\STAGE-GEN2_16-02-2020-01-55-53 (1).log, offset: 1824
2020-06-11T13:01:41.607+0530 DEBUG [input] log/input.go:563 Harvester for file is still running: C:\Users\tushar\Documents\logs\STAGE-GEN2_16-02-2020-01-55-53 (1).log
2020-06-11T13:01:41.607+0530 DEBUG [input] log/input.go:421 Check file for harvesting: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_14-02-2020-18-00-08.log
2020-06-11T13:01:41.607+0530 DEBUG [input] log/input.go:511 Update existing file for harvesting: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_14-02-2020-18-00-08.log, offset: 553
2020-06-11T13:01:41.607+0530 DEBUG [input] log/input.go:563 Harvester for file is still running: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_14-02-2020-18-00-08.log
2020-06-11T13:01:41.607+0530 DEBUG [input] log/input.go:421 Check file for harvesting: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_14-12-2019-10-00-07.log
2020-06-11T13:01:41.607+0530 DEBUG [input] log/input.go:511 Update existing file for harvesting: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_14-12-2019-10-00-07.log, offset: 1297
2020-06-11T13:01:41.607+0530 DEBUG [input] log/input.go:563 Harvester for file is still running: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_14-12-2019-10-00-07.log
2020-06-11T13:01:41.608+0530 DEBUG [input] log/input.go:421 Check file for harvesting: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_15-01-2020-22-00-09.log
2020-06-11T13:01:41.608+0530 DEBUG [input] log/input.go:511 Update existing file for harvesting: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_15-01-2020-22-00-09.log, offset: 1414
2020-06-11T13:01:41.608+0530 DEBUG [input] log/input.go:563 Harvester for file is still running: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_15-01-2020-22-00-09.log
2020-06-11T13:01:41.608+0530 DEBUG [input] log/input.go:421 Check file for harvesting: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_15-02-2020-10-00-17.log
2020-06-11T13:01:41.608+0530 DEBUG [input] log/input.go:511 Update existing file for harvesting: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_15-02-2020-10-00-17.log, offset: 553
2020-06-11T13:01:41.608+0530 DEBUG [input] log/input.go:563 Harvester for file is still running: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_15-02-2020-10-00-17.log
2020-06-11T13:01:41.608+0530 DEBUG [input] log/input.go:212 input states cleaned up. Before: 273, After: 273, Pending: 0

Some more like this:

-GEN2_15-02-2020-18-00-14.log; Backoff now.
2020-06-11T13:02:52.453+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\STAGE-GEN2_31-01-2020-13-30-04.log; Backoff now.
2020-06-11T13:02:52.453+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\STAGE-GEN2_16-02-2020-01-55-53.log; Backoff now.
2020-06-11T13:02:52.454+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_23-05-2020-14-00-07 - Copy.log; Backoff now.
2020-06-11T13:02:52.454+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_15-02-2020-14-00-10.log; Backoff now.
2020-06-11T13:02:52.455+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PIE-GEN2_01-04-2020-21-30-09.log; Backoff now.
2020-06-11T13:02:52.455+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_14-03-2020-16-00-08.log; Backoff now.
2020-06-11T13:02:52.455+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_15-01-2020-20-00-09.log; Backoff now.
2020-06-11T13:02:52.456+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_18-02-2020-14-00-04.log; Backoff now.
2020-06-11T13:02:52.456+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_15-01-2020-13-00-04.log; Backoff now.
2020-06-11T13:02:52.456+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_18-02-2020-14-00-04 (1).log; Backoff now.
2020-06-11T13:02:52.457+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_14-02-2020-13-00-04.log; Backoff now.
2020-06-11T13:02:52.457+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_15-01-2020-10-00-07.log; Backoff now.
2020-06-11T13:02:52.458+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_14-02-2020-19-00-11.log; Backoff now.
2020-06-11T13:02:52.458+0530 DEBUG [harvester] log/log.go:107 End of file reached: C:\Users\tushar\Documents\logs\PRODUCTION-GEN2_14-03-2020-07-00-05.log; Backoff now.

Here is my logstash.conf file:

<input{

beats{
           port => "5044"

}

}

filter{

grok{

    match => {"message" => "\[%{LOGLEVEL:class}\] %{TIMESTAMP_ISO8601:timestamp} %{GREEDYDATA:javaclass} - %{GREEDYDATA:stackname}-%{GREEDYDATA:versionnumber} %{GREEDYDATA:servicename} \[%{DATA:procedure}\] \[%{DATA:value}\] %{GREEDYDATA:status} \[%{GREEDYDATA:statuscode}\]"}

}

date {

    match => ["timestamp", "ISO8601"]

}

}

output{

elasticsearch{

    hosts => "http://localhost:9200"

    index => "filebeatlogs"

}

stdout{}

}/>

Here is my filebeat.yml output data:
#----------------------------- Logstash output --------------------------------
output.logstash:

The Logstash hosts

hosts: ["http://192.168.0.103: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"

I am not able to see the logs data being read by logstash. Can you tell me why this is happening I think that everything is configured fine to load the data. Thanks in advance.

What changes do I have to make in logstash.yml? I have made host as http.host: "192.168.0.103" so that logstash can be accessed from any other machine. But data is not being pushed to logstash.

Hi @TUSHAR_Sinha,

From the debug logs you share from filebeat, it seems that it is harvesting the files. So the problem seems to be in the output or in the logstash configuration. Do you see something related to logstash in the filebeat logs?
Do you see some errors in the logstash logs?
In Elasticsearch, does the filebeatlogs index contain any document?

By the way, if you are using logstash only to do some parsing of the logs, you can consider using filebeat processors, or elasticsearch ingest pipelines instead. This way you could send the logs directly from filebeat to elasticsearch, what uses to be easier to setup.

Hi @jsoriano,

Thank you for your response. I just checked my filebeat logs and there was an error I am sharing the filebeat logs.

2020-06-09T01:01:35.330+0530	INFO	instance/beat.go:621	Home path: [C:\elastic_stack\filebeat-7.7.1-windows-x86_64\filebeat-7.7.1-windows-x86_64] Config path: [C:\elastic_stack\filebeat-7.7.1-windows-x86_64\filebeat-7.7.1-windows-x86_64] Data path: [C:\elastic_stack\filebeat-7.7.1-windows-x86_64\filebeat-7.7.1-windows-x86_64\data] Logs path: [C:\elastic_stack\filebeat-7.7.1-windows-x86_64\filebeat-7.7.1-windows-x86_64\logs]
2020-06-09T01:01:35.356+0530	INFO	instance/beat.go:629	Beat ID: cd93bbc9-10dc-4ed0-a049-4189d5f3ee4f
2020-06-09T01:01:35.361+0530	INFO	[beat]	instance/beat.go:957	Beat info	{"system_info": {"beat": {"path": {"config": "C:\\elastic_stack\\filebeat-7.7.1-windows-x86_64\\filebeat-7.7.1-windows-x86_64", "data": "C:\\elastic_stack\\filebeat-7.7.1-windows-x86_64\\filebeat-7.7.1-windows-x86_64\\data", "home": "C:\\elastic_stack\\filebeat-7.7.1-windows-x86_64\\filebeat-7.7.1-windows-x86_64", "logs": "C:\\elastic_stack\\filebeat-7.7.1-windows-x86_64\\filebeat-7.7.1-windows-x86_64\\logs"}, "type": "filebeat", "uuid": "cd93bbc9-10dc-4ed0-a049-4189d5f3ee4f"}}}
2020-06-09T01:01:35.363+0530	INFO	[beat]	instance/beat.go:966	Build info	{"system_info": {"build": {"commit": "932b273e8940575e15f10390882be205bad29e1f", "libbeat": "7.7.1", "time": "2020-05-28T15:24:10.000Z", "version": "7.7.1"}}}
2020-06-09T01:01:35.363+0530	INFO	[beat]	instance/beat.go:969	Go runtime info	{"system_info": {"go": {"os":"windows","arch":"amd64","max_procs":12,"version":"go1.13.9"}}}
2020-06-09T01:01:35.451+0530	INFO	[beat]	instance/beat.go:973	Host info	{"system_info": {"host": {"architecture":"x86_64","boot_time":"2020-06-04T09:21:07.66+05:30","name":"TUSHAR1","ip":["fe80::8927:c9ec:6449:240d/64","15.52.71.30/32","169.254.36.13/16","fe80::4844:ffa9:1423:e513/64","169.254.229.19/16","fe80::b0c9:4542:531:7819/64","169.254.120.25/16","fe80::5dfb:a1c8:3596:e11e/64","169.254.225.30/16","fe80::dd81:c228:f99e:8aaa/64","192.168.0.9/24","fe80::94f5:1c0f:cdda:6828/64","169.254.104.40/16","::1/128","127.0.0.1/8","fd3c:e9f4:c7da:c8a1:b4de:3a5f:cc19:4475/64","fd3c:e9f4:c7da:c8a1:b1c3:6678:f1c3:a51a/128","fe80::b4de:3a5f:cc19:4475/64"],"kernel_version":"10.0.17763.1217 (WinBuild.160101.0800)","mac":["02:50:41:00:00:01","b0:0c:d1:6a:15:54","04:ea:56:1b:27:6e","06:ea:56:1b:27:6d","04:ea:56:1b:27:6d","04:ea:56:1b:27:71","00:00:00:00:00:00:00:e0"],"os":{"family":"windows","platform":"windows","name":"Windows 10 Enterprise","version":"10.0","major":10,"minor":0,"patch":0,"build":"17763.1217"},"timezone":"IST","timezone_offset_sec":19800,"id":"19eeccd2-186c-4ef8-b441-b84cab284917"}}}
2020-06-09T01:01:35.470+0530	INFO	[beat]	instance/beat.go:1002	Process info	{"system_info": {"process": {"cwd": "C:\\elastic_stack\\filebeat-7.7.1-windows-x86_64\\filebeat-7.7.1-windows-x86_64", "exe": "C:\\elastic_stack\\filebeat-7.7.1-windows-x86_64\\filebeat-7.7.1-windows-x86_64\\filebeat.exe", "name": "filebeat.exe", "pid": 38896, "ppid": 41260, "start_time": "2020-06-09T01:01:34.626+0530"}}}
2020-06-09T01:01:35.470+0530	INFO	instance/beat.go:297	Setup Beat: filebeat; Version: 7.7.1
2020-06-09T01:01:35.471+0530	INFO	[publisher]	pipeline/module.go:110	Beat name: TUSHAR1
2020-06-09T01:01:35.472+0530	INFO	instance/beat.go:411	filebeat stopped.
2020-06-09T01:01:35.479+0530	ERROR	instance/beat.go:932	Exiting: 1 error: setting 'filebeat.prospectors' has been removed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I have the filebeat.prospectors, but still it is showing this error that it has been removed. Below is my filebeat.yml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        ###################### Filebeat Configuration Example #########################
# This file is an example configuration file highlighting only the most common
# options. The filebeat.reference.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

# For more available modules and options, please see the filebeat.reference.yml sample
# configuration file.

#=========================== Filebeat inputs =============================

filebeat.inputs:

# Each - is an input. Most options can be set at the input level, so
# you can use different inputs for various configurations.
# Below are the input specific configurations.

- type: log

  # Change to true to enable this input configuration.
  enabled: true

  # Paths that should be crawled and fetched. Glob based paths.
  paths:
    - c:\Users\tushar\Documents\logfiles\*.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: ['^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 fields can be freely picked
  # to add additional information to the crawled log files for filtering
  #fields:
  #  level: debug
  #  review: 1

  ### Multiline options

  # Multiline 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


#============================= Filebeat modules ===============================

#filebeat.config.modules:
  # Glob pattern for configuration loading
  #path: ${path.config}/modules.d/*.yml

  # Set to true to enable config reloading
  #reload.enabled: true

  # Period on which files under path should be checked for changes
  #reload.period: 10s

#==================== Elasticsearch template setting ==========================

#setup.template.settings:
  #index.number_of_shards: 1
  #index.codec: best_compression
  #_source.enabled: false

#================================ 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


#============================== Dashboards =====================================
# These settings control loading the sample dashboards to the Kibana index. Loading
# the dashboards is disabled by default and can be enabled either by setting the
# options here or by using the `setup` command.
#setup.dashboards.enabled: false

# The URL from where to download the dashboards archive. By default this URL
# has a value which is computed based on the Beat name and version. For released
# versions, this URL points to the dashboard archive on the artifacts.elastic.co
# website.
#setup.dashboards.url:

#============================== Kibana =====================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  #host: "localhost:5601"

  # Kibana Space ID
  # ID of the Kibana Space into which the dashboards should be loaded. By default,
  # the Default Space will be used.
  #space.id:

#============================= Elastic Cloud ==================================

# These settings simplify using Filebeat with the Elastic Cloud (https://cloud.elastic.co/).

# The cloud.id setting overwrites the `output.elasticsearch.hosts` and
# `setup.kibana.host` options.
# You can find the `cloud.id` in the Elastic Cloud web UI.
#cloud.id:

# The cloud.auth setting overwrites the `output.elasticsearch.username` and
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
#cloud.auth:

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

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

#-------------------------- Elasticsearch output ------------------------------
#output.elasticsearch:
  # Array of hosts to connect to.
  #hosts: ["localhost:9200"]

  # Protocol - either `http` (default) or `https`.
  #protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  #username: "elastic"
  #password: "changeme"

#----------------------------- Logstash output --------------------------------
output.logstash:
  # The Logstash hosts
  hosts: ["http://192.168.0.103: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"

#================================ Processors =====================================

# Configure processors to enhance or manipulate events generated by the beat.

processors:
  - add_host_metadata: ~
  - add_cloud_metadata: ~
  - add_docker_metadata: ~
  - add_kubernetes_metadata: ~

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

# Sets log level. The default log level is info.
# Available log levels are: 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: ["*"]

#============================== X-Pack Monitoring ===============================
# filebeat can export internal metrics to a central Elasticsearch monitoring
# cluster.  This requires xpack monitoring to be enabled in Elasticsearch.  The
# reporting is disabled by default.

# Set to true to enable the monitoring reporter.
#monitoring.enabled: false

# Sets the UUID of the Elasticsearch cluster under which monitoring data for this
# Filebeat instance will appear in the Stack Monitoring UI. If output.elasticsearch
# is enabled, the UUID is derived from the Elasticsearch cluster referenced by output.elasticsearch.
#monitoring.cluster_uuid:

# Uncomment to send the metrics to Elasticsearch. Most settings from the
# Elasticsearch output are accepted here as well.
# Note that the settings should point to your Elasticsearch *monitoring* cluster.
# Any setting that is not set is automatically inherited from the Elasticsearch
# output configuration, so if you have the Elasticsearch output configured such
# that it is pointing to your Elasticsearch monitoring cluster, you can simply
# uncomment the following line.
#monitoring.elasticsearch:

#================================= Migration ==================================

# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: true
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Umm, I don't see filebeat.prospectors in you configuration file. Is it possible that this instance of filebeat is using other configuration file?

Actually this is the file which was present there in the filebeat when I downloaded it. Earlier I was using the same filebeat.yml and it was running fine on localhost. You can see in the Logstash Output I have given my machine local Lan IP after that only the issue was arising.

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