Filebeat unable to sent logs

Hey,

logstash conf file

esbjs:/usr/share/logstash/bin # cat logstash_filebeat.conf
input {
beats {
port => 5045
}
}

output {
elasticsearch {
hosts => ["10.10.73.228:9200"]
index => "filebeat"
document_type => "demo"
}
stdout { codec => rubydebug }
}

logstash log

esbjs:/var/log/logstash # tail -50 logstash-plain.log
[2018-06-20T14:43:05,031][INFO ][logstash.agent ] No config files found in path {:path=>"/etc/logstash/conf.d/"}
[2018-06-20T14:43:05,033][ERROR][logstash.agent ] failed to fetch pipeline configuration {:message=>"No config files found: /etc/logstash/conf.d. Can you make sure this path is a logstash config file?"}
[2018-06-20T14:43:14,409][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"}
[2018-06-20T14:43:14,412][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/usr/share/logstash/modules/netflow/configuration"}
[2018-06-20T14:43:14,495][INFO ][logstash.agent ] No config files found in path {:path=>"/etc/logstash/conf.d/
"}
[2018-06-20T14:43:14,497][ERROR][logstash.agent ] failed to fetch pipeline configuration {:message=>"No config files found: /etc/logstash/conf.d. Can you make sure this path is a logstash config file?"}
[2018-06-20T14:43:23,604][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"}
[2018-06-20T14:43:23,607][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/usr/share/logstash/modules/netflow/configuration"}
[2018-06-20T14:43:23,683][INFO ][logstash.agent ] No config files found in path {:path=>"/etc/logstash/conf.d/"}
[2018-06-20T14:43:23,687][ERROR][logstash.agent ] failed to fetch pipeline configuration {:message=>"No config files found: /etc/logstash/conf.d. Can you make sure this path is a logstash config file?"}
[2018-06-20T14:43:33,296][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"}
[2018-06-20T14:43:33,299][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/usr/share/logstash/modules/netflow/configuration"}
[2018-06-20T14:43:33,372][INFO ][logstash.agent ] No config files found in path {:path=>"/etc/logstash/conf.d/
"}
[2018-06-20T14:43:33,374][ERROR][logstash.agent ] failed to fetch pipeline configuration {:message=>"No config files found: /etc/logstash/conf.d. Can you make sure this path is a logstash config file?"}
[2018-06-20T14:43:43,245][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"}
[2018-06-20T14:43:43,248][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/usr/share/logstash/modules/netflow/configuration"}
[2018-06-20T14:43:43,327][INFO ][logstash.agent ] No config files found in path {:path=>"/etc/logstash/conf.d/*"}
[2018-06-20T14:43:43,330][ERROR][logstash.agent ] failed to fetch pipeline configuration {:message=>"No config files found: /etc/logstash/conf.d. Can you make sure this path is a logstash config file?"}
[2018-06-20T14:43:52,422][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"}

Hi,

Yes this is the problem logstash not able to read your config file.

Please keep your config file under path: /etc/logstash/conf.d/ and restart logstash.

Regards,

Hey,

I have kept conf file in /etc/logstash/conf.d directory but still not able to create index for filebeat. There is no logstash logs of today. The logs wich I have sent you was yesterday logs

is your logstash running, please restart and check the logs of logstash. Because your filebeat logs are seems ok. no issue.

Regards,

Hey,

Thank you so much for all your replies. Will try it and let you know.

Hey,

Still, I am getting the same error. My logstash up and running. For the investigation, I checked filebeat logs it says something like below...

File didn't change: /var/log/zypper.log
2018-07-12T17:44:36+05:30 DBG Prospector states cleaned up. Before: 6, After: 6

Is it a normal behavior of filebeat or it seems error? @harshbajaj16

Thank you.

Hi @mamta,

Yes its normal this is not an error. It's because your file have no new data and it checks and report that file didn't change.

Regards,

Thank you.
But I am not able to create an index on kibana.

Hi @mamta,

Request you to share the logs of elasticsearch and logstash and highlight the error if you are able to find.

Please check and share config files of logstash and elasticsearch.

Regards.

Hi @harshbajaj16,
I have configured filebeat logs through logstash.

Elasticsearch log

esbjs:/var/log/elasticsearch # cat elasticsearch.log
[2018-07-13T00:00:02,264][INFO ][o.e.c.m.MetaDataCreateIndexService] [Jwj4-fB] [metricbeat-6.2.3-2018.07.13] creating index, cause [auto(bulk api)], templates [metricbeat-6.2.3], shards [1]/[1], mappings [default]
[2018-07-13T00:00:02,480][INFO ][o.e.c.m.MetaDataMappingService] [Jwj4-fB] [metricbeat-6.2.3-2018.07.13/3imOBUpxQEqDlR7MnHbyng] create_mapping [doc]

Logstash Log

[2018-07-13T17:13:20,725][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<ArgumentError: Path "/var/lib/logstash/queue" must be a writable directory. It is not writable.>, :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/settings.rb:439:in validate'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:222:invalidate_value'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:138:in validate_all'", "org/jruby/RubyHash.java:1342:ineach'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:137:in validate_all'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:243:inexecute'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:204:inrun'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in run'", "/usr/share/logstash/lib/bootstrap/environment.rb:71:in(root)'"]}
[2018-07-13T17:13:30,814][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"}
[2018-07-13T17:13:30,817][DEBUG][logstash.plugins.registry] Adding plugin to the registry {:name=>"fb_apache", :type=>:modules, :class=>#<LogStash::Modules::Scaffold:0x3a1f6ec5 @kibana_version_parts=["5", "6", "0"], @module_name="fb_apache", @directory="/usr/share/logstash/modules/fb_apache/configuration">}
[2018-07-13T17:13:30,817][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/usr/share/logstash/modules/netflow/configuration"}
[2018-07-13T17:13:30,817][DEBUG][logstash.plugins.registry] Adding plugin to the registry {:name=>"netflow", :type=>:modules, :class=>#<LogStash::Modules::Scaffold:0x51e24212 @kibana_version_parts=["5", "6", "0"], @module_name="netflow", @directory="/usr/share/logstash/modules/netflow/configuration">}

Elasticsearch configuration file

esbjs:/etc/elasticsearch # cat elasticsearch.yml

======================== Elasticsearch Configuration =========================

NOTE: Elasticsearch comes with reasonable defaults for most settings.

Before you set out to tweak and tune the configuration, make sure you

understand what are you trying to accomplish and the consequences.

The primary way of configuring a node is via this file. This template lists

the most important settings you may want to configure for a production cluster.

Please consult the documentation for further information on configuration options:

https://www.elastic.co/guide/en/elasticsearch/reference/index.html

---------------------------------- Cluster -----------------------------------

Use a descriptive name for your cluster:

#cluster.name: my-application

------------------------------------ Node ------------------------------------

Use a descriptive name for the node:

#node.name: node-1

Add custom attributes to the node:

#node.attr.rack: r1

----------------------------------- Paths ------------------------------------

Path to directory where to store the data (separate multiple locations by comma):

#path.data: /path/to/data

Path to log files:

#path.logs: /path/to/logs

----------------------------------- Memory -----------------------------------

Lock the memory on startup:

#bootstrap.memory_lock: true

Make sure that the heap size is set to about half the memory available

on the system and that the owner of the process is allowed to use this

limit.

Elasticsearch performs poorly when the system is swapping the memory.

---------------------------------- Network -----------------------------------

Set the bind address to a specific IP (IPv4 or IPv6):

network.host: 10.10.73.228

Set a custom port for HTTP:

#http.port: 9200

For more information, consult the network module documentation.

--------------------------------- Discovery ----------------------------------

Pass an initial list of hosts to perform discovery when new node is started:

The default list of hosts is ["127.0.0.1", "[::1]"]

#discovery.zen.ping.unicast.hosts: ["host1", "host2"]

Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):

#discovery.zen.minimum_master_nodes: 3

For more information, consult the zen discovery module documentation.

---------------------------------- Gateway -----------------------------------

Block initial recovery after a full cluster restart until N nodes are started:

#gateway.recover_after_nodes: 3

For more information, consult the gateway module documentation.

---------------------------------- Various -----------------------------------

Require explicit names when deleting indices:

#action.destructive_requires_name: true

Logstash configuration file

esbjs:/etc/logstash # cat logstash.yml

Settings file in YAML

Settings can be specified either in hierarchical form, e.g.:

pipeline:

batch:

size: 125

delay: 5

Or as flat keys:

pipeline.batch.size: 125

pipeline.batch.delay: 5

------------ Node identity ------------

Use a descriptive name for the node:

node.name: test

If omitted the node name will default to the machine's host name

------------ Data path ------------------

Which directory should be used by logstash and its plugins

for any persistent needs. Defaults to LOGSTASH_HOME/data

path.data: /var/lib/logstash

------------ Pipeline Settings --------------

Set the number of workers that will, in parallel, execute the filters+outputs

stage of the pipeline.

This defaults to the number of the host's CPU cores.

pipeline.workers: 2

How many workers should be used per output plugin instance

pipeline.output.workers: 1

How many events to retrieve from inputs before sending to filters+workers

pipeline.batch.size: 125

How long to wait before dispatching an undersized batch to filters+workers

Value is in milliseconds.

pipeline.batch.delay: 5

Force Logstash to exit during shutdown even if there are still inflight

events in memory. By default, logstash will refuse to quit until all

received events have been pushed to the outputs.

WARNING: enabling this can lead to data loss during shutdown

pipeline.unsafe_shutdown: false

------------ Pipeline Configuration Settings --------------

Where to fetch the pipeline configuration for the main pipeline

path.config: /etc/logstash/conf.d

Pipeline configuration string for the main pipeline

config.string:

At startup, test if the configuration is valid and exit (dry run)

config.test_and_exit: false

Periodically check if the configuration has changed and reload the pipeline

This can also be triggered manually through the SIGHUP signal

config.reload.automatic: false

How often to check if the pipeline configuration has changed (in seconds)

config.reload.interval: 3

Show fully compiled configuration as debug log message

NOTE: --log.level must be 'debug'

config.debug: false

When enabled, process escaped characters such as \n and " in strings in the

pipeline configuration files.

config.support_escapes: false

------------ Module Settings ---------------

Define modules here. Modules definitions must be defined as an array.

The simple way to see this is to prepend each name with a -, and keep

all associated variables under the name they are associated with, and

above the next, like this:

modules:

- name: MODULE_NAME

var.PLUGINTYPE1.PLUGINNAME1.KEY1: VALUE

var.PLUGINTYPE1.PLUGINNAME1.KEY2: VALUE

var.PLUGINTYPE2.PLUGINNAME1.KEY1: VALUE

var.PLUGINTYPE3.PLUGINNAME3.KEY1: VALUE

Module variable names must be in the format of

var.PLUGIN_TYPE.PLUGIN_NAME.KEY

modules:

------------ Queuing Settings --------------

Internal queuing model, "memory" for legacy in-memory based queuing and

"persisted" for disk-based acked queueing. Defaults is memory

queue.type: memory

If using queue.type: persisted, the directory path where the data files will be stored.

Default is path.data/queue

path.queue:

If using queue.type: persisted, the page data files size. The queue data consists of

append-only data files separated into pages. Default is 250mb

queue.page_capacity: 250mb

If using queue.type: persisted, the maximum number of unread events in the queue.

Default is 0 (unlimited)

queue.max_events: 0

If using queue.type: persisted, the total capacity of the queue in number of bytes.

If you would like more unacked events to be buffered in Logstash, you can increase the

capacity using this setting. Please make sure your disk drive has capacity greater than

the size specified here. If both max_bytes and max_events are specified, Logstash will pick

whichever criteria is reached first

Default is 1024mb or 1gb

queue.max_bytes: 1024mb

If using queue.type: persisted, the maximum number of acked events before forcing a checkpoint

Default is 1024, 0 for unlimited

queue.checkpoint.acks: 1024

If using queue.type: persisted, the maximum number of written events before forcing a checkpoint

Default is 1024, 0 for unlimited

queue.checkpoint.writes: 1024

If using queue.type: persisted, the interval in milliseconds when a checkpoint is forced on the head page

Default is 1000, 0 for no periodic checkpoint.

queue.checkpoint.interval: 1000

------------ Dead-Letter Queue Settings --------------

Flag to turn on dead-letter queue.

dead_letter_queue.enable: false

If using dead_letter_queue.enable: true, the maximum size of each dead letter queue. Entries

will be dropped if they would increase the size of the dead letter queue beyond this setting.

Default is 1024mb

dead_letter_queue.max_bytes: 1024mb

If using dead_letter_queue.enable: true, the directory path where the data files will be stored.

Default is path.data/dead_letter_queue

path.dead_letter_queue:

------------ Metrics Settings --------------

Bind address for the metrics REST endpoint

http.host: "127.0.0.1"

Bind port for the metrics REST endpoint, this option also accept a range

(9600-9700) and logstash will pick up the first available ports.

http.port: 9600-9700

------------ Debugging Settings --------------

Options for log.level:

* fatal

* error

* warn

* info (default)

* debug

* trace

log.level: debug
path.logs: /var/log/logstash

------------ Other Settings --------------

Where to find custom plugins

path.plugins: []

Hi,

Have you checked this error as its showing some not a writable directory. Please check this.

Regards,

1 Like

Hi @harshbajaj16,

Thank you reply.

I have checked that logs and given all the permission to the queue directory. That error is resolved but now I am getting different error. I am sending you that logs, please check it.
Thank you in advance.

[2018-07-16T12:15:25,092][DEBUG][io.netty.handler.ssl.CipherSuiteConverter] Cipher suite mapping: TLS_PSK_WITH_AES_256_CBC_SHA => PSK-AES256-CBC-SHA
[2018-07-16T12:15:25,092][DEBUG][io.netty.handler.ssl.CipherSuiteConverter] Cipher suite mapping: SSL_PSK_WITH_AES_256_CBC_SHA => PSK-AES256-CBC-SHA
[2018-07-16T12:15:25,092][DEBUG][io.netty.handler.ssl.CipherSuiteConverter] Cipher suite mapping: TLS_RSA_WITH_3DES_EDE_CBC_SHA => DES-CBC3-SHA
[2018-07-16T12:15:25,092][DEBUG][io.netty.handler.ssl.CipherSuiteConverter] Cipher suite mapping: SSL_RSA_WITH_3DES_EDE_CBC_SHA => DES-CBC3-SHA
[2018-07-16T12:15:25,092][DEBUG][io.netty.handler.ssl.CipherSuiteConverter] Cipher suite mapping: TLS_RSA_WITH_RC4_128_SHA => RC4-SHA
[2018-07-16T12:15:25,092][DEBUG][io.netty.handler.ssl.CipherSuiteConverter] Cipher suite mapping: SSL_RSA_WITH_RC4_128_SHA => RC4-SHA
[2018-07-16T12:15:25,092][DEBUG][io.netty.handler.ssl.CipherSuiteConverter] Cipher suite mapping: TLS_PSK_WITH_RC4_128_SHA => PSK-RC4-SHA
[2018-07-16T12:15:25,092][DEBUG][io.netty.handler.ssl.CipherSuiteConverter] Cipher suite mapping: SSL_PSK_WITH_RC4_128_SHA => PSK-RC4-SHA
[2018-07-16T12:15:25,092][DEBUG][io.netty.handler.ssl.CipherSuiteConverter] Cipher suite mapping: TLS_RSA_WITH_RC4_128_MD5 => RC4-MD5
[2018-07-16T12:15:25,093][DEBUG][io.netty.handler.ssl.CipherSuiteConverter] Cipher suite mapping: SSL_RSA_WITH_RC4_128_MD5 => RC4-MD5
[2018-07-16T12:15:25,094][INFO ][logstash.inputs.beats ] Beats inputs: Starting input listener {:address=>"0.0.0.0:5045"}
[2018-07-16T12:15:25,102][DEBUG][io.netty.channel.MultithreadEventLoopGroup] -Dio.netty.eventLoopThreads: 4
[2018-07-16T12:15:25,125][DEBUG][io.netty.channel.nio.NioEventLoop] -Dio.netty.noKeySetOptimization: false
[2018-07-16T12:15:25,125][DEBUG][io.netty.channel.nio.NioEventLoop] -Dio.netty.selectorAutoRebuildThreshold: 512
[2018-07-16T12:15:25,136][INFO ][logstash.pipeline ] Pipeline main started
[2018-07-16T12:15:25,146][INFO ][org.logstash.beats.Server] Starting server on port: 5045
[2018-07-16T12:15:25,173][DEBUG][logstash.agent ] Starting puma
[2018-07-16T12:15:25,174][DEBUG][io.netty.channel.DefaultChannelId] -Dio.netty.processId: 53531 (auto-detected)
[2018-07-16T12:15:25,177][DEBUG][io.netty.util.NetUtil ] Loopback interface: lo (lo, 0:0:0:0:0:0:0:1%lo)
[2018-07-16T12:15:25,178][DEBUG][io.netty.util.NetUtil ] /proc/sys/net/core/somaxconn: 128
[2018-07-16T12:15:25,178][DEBUG][io.netty.channel.DefaultChannelId] -Dio.netty.machineId: 00:15:5d:ff:fe:76:0d:15 (auto-detected)
[2018-07-16T12:15:25,182][DEBUG][logstash.agent ] Trying to start WebServer {:port=>9600}
[2018-07-16T12:15:25,195][DEBUG][logstash.api.service ] [api-service] start
[2018-07-16T12:15:25,216][DEBUG][logstash.agent ] Trying to start WebServer {:port=>9601}
[2018-07-16T12:15:25,216][DEBUG][logstash.api.service ] [api-service] start
[2018-07-16T12:15:25,219][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9601}
[2018-07-16T12:15:30,136][DEBUG][logstash.pipeline ] Pushing flush onto pipeline
[2018-07-16T12:15:35,137][DEBUG][logstash.pipeline ] Pushing flush onto pipeline

Hi,

It seems you implement Cipher suite mapping: TLS_RSA_WITH_RC4_128_MD5 in your config file. please check and share that config file so that i can chech and revert accordingly.

Regards,

Hi @harshbajaj16,

I kept logstash in debug mode but I am not using any encryption algorithms like Cipher suite mapping: TLS_RSA_WITH_RC4_128_MD5 . What this error means [2018-07-16T17:47:16,495][DEBUG][logstash.pipeline ] Pushing flush onto pipeline. I am sending you logstash.conf file.

https://pastebin.com/raw/SS38F7KM

Hi,

That seems ok, request you to share the filebeat.yml file here for more debugging.

Regards,

Hi @harshbajaj16,

I am sharing filebeat.yml with you.
Thank you.

https://pastebin.com/raw/7MHxBEgz

Hi,

i've checked the same and that seems ok and u haven't configure cipher suites anywhere.

can you please check /var/log/messages while starting filebeat and logstash. because if there is some indentation in filebeat.yml then messages logs will show that info. please check and let me know.

Regards,

Hi @harshbajaj16,

I have checked ELK server /var/log/messages of logstash of yesterday logs and there is no messages on filebeat server related to filebeat.

https://pastebin.com/raw/FktnKCkF

Today I restarted logstash and new message generated as below

2018-07-17T10:46:46.243370+05:30 esbjs liblogging-stdlog: -- MARK --
2018-07-17T10:49:13.042966+05:30 esbjs systemd[1]: Stopping logstash...
2018-07-17T10:49:19.462226+05:30 esbjs systemd[1]: Stopped logstash.
2018-07-17T10:49:19.478100+05:30 esbjs systemd[1]: Started logstash.
2018-07-17T10:49:30.116567+05:30 esbjs logstash[35617]: Sending Logstash's logs to /var/log/logstash which is now configured via log4j2.properties
2018-07-17T11:00:01.757300+05:30 esbjs cron[36009]: pam_unix(crond:session): session opened for user root by (uid=0)
2018-07-17T11:00:01.772059+05:30 esbjs systemd[1]: Started Session 8536 of user root.
2018-07-17T11:00:01.793062+05:30 esbjs CRON[36009]: pam_unix(crond:session): session closed for user root