Hi,
Logstash: 5.6.1
Additional plugins:
- x-pack (5.6.1)
- logstash-filter-prune (3.0.3)
I'm observing some strange behaviour when running Logstash config test when an instance of Logstash is already running with the DLQ enabled.
I am running /usr/local/logstash/bin/logstash -f /etc/logstash/conf.d/ -t
after Logstash has been configured & started, so there is already a running Logstash instance when I run the test:
/usr/bin/java -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -Xmx512m -Xms512m -Xss2048k -Djffi.boot.library.path=/usr/local/logstash-5.6.1/vendor/jruby/lib/jni -Xbootclasspath/a:/usr/local/logstash-5.6.1/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/usr/local/logstash-5.6.1/vendor/jruby -Djruby.lib=/usr/local/logstash-5.6.1/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main /usr/local/logstash/lib/bootstrap/environment.rb logstash/runner.rb --path.settings /usr/local/logstash/config
Running the config test with debug I can see it hangs at the below:
[2018-02-22T11:57:05,017][DEBUG][logstash.runner ] --------------- Logstash Settings -------------------
[2018-02-22T11:57:05,023][DEBUG][logstash.runner ] Reading config file {:config_file=>"/etc/logstash/conf.d/logstash_test.conf"}
[2018-02-22T11:57:05,024][DEBUG][logstash.runner ] Reading config file {:config_file=>"/etc/logstash/conf.d/shipping_application_logs.conf"}
[2018-02-22T11:57:05,024][DEBUG][logstash.runner ] Reading config file {:config_file=>"/etc/logstash/conf.d/shipping_asm.conf"}
[2018-02-22T11:57:05,025][DEBUG][logstash.runner ] Reading config file {:config_file=>"/etc/logstash/conf.d/shipping_beats.conf"}
[2018-02-22T11:57:05,025][DEBUG][logstash.runner ] Reading config file {:config_file=>"/etc/logstash/conf.d/shipping_infrastructure_logs.conf"}
[2018-02-22T11:57:05,026][DEBUG][logstash.runner ] Reading config file {:config_file=>"/etc/logstash/conf.d/shipping_metrics20.conf"}
[2018-02-22T11:57:05,026][DEBUG][logstash.runner ] Reading config file {:config_file=>"/etc/logstash/conf.d/shipping_sensu.conf"}
[2018-02-22T11:57:05,026][DEBUG][logstash.runner ] Reading config file {:config_file=>"/etc/logstash/conf.d/shipping_system_logs.conf"}
If I stop Logstash and run the config test it works fine, and the output that follows the above is initialisation of the input plugins:
2018-02-22T12:00:40,360][DEBUG][logstash.plugins.registry] On demand adding plugin to the registry {:name=>"syslog", :type=>"input", :class=>LogStash::Inputs::Syslog}
[2018-02-22T12:00:40,374][DEBUG][logstash.plugins.registry] On demand adding plugin to the registry {:name=>"plain", :type=>"codec", :class=>LogStash::Codecs::Plain}
[2018-02-22T12:00:40,376][DEBUG][logstash.codecs.plain ] config LogStash::Codecs::Plain/@id = "plain_7d54ba1e-1ad6-42fe-b3d7-88a64fc4065d"
[2018-02-22T12:00:40,376][DEBUG][logstash.codecs.plain ] config LogStash::Codecs::Plain/@enable_metric = true
[2018-02-22T12:00:40,377][DEBUG][logstash.codecs.plain ] config LogStash::Codecs::Plain/@charset = "UTF-8"
[2018-02-22T12:00:40,378][DEBUG][logstash.inputs.syslog ] config LogStash::Inputs::Syslog/@port = 5000
[2018-02-22T12:00:40,378][DEBUG][logstash.inputs.syslog ] config LogStash::Inputs::Syslog/@type = "test"
[2018-02-22T12:00:40,378][DEBUG][logstash.inputs.syslog ] config LogStash::Inputs::Syslog/@id = "77197fd5f8e37039a8c6b680833438b68075726e-1"
[2018-02-22T12:00:40,378][DEBUG][logstash.inputs.syslog ] config LogStash::Inputs::Syslog/@enable_metric = true
[2018-02-22T12:00:40,379][DEBUG][logstash.inputs.syslog ] config LogStash::Inputs::Syslog/@codec = <LogStash::Codecs::Plain id=>"plain_7d54ba1e-1ad6-42fe-b3d7-88a64fc4065d", enable_metric=>true, charset=>"UTF-8">
[2018-02-22T12:00:40,379][DEBUG][logstash.inputs.syslog ] config LogStash::Inputs::Syslog/@add_field = {}
[2018-02-22T12:00:40,379][DEBUG][logstash.inputs.syslog ] config LogStash::Inputs::Syslog/@host = "0.0.0.0"
So the config test only fails when Logstash is already running; however I think I've narrowed it down a bit further. If I change my main Logstash config (/usr/local/logstash/config/logstash.yml) to set DLQ to false (previously true), the config test successfully runs and completes, even when Logstash is already running in the background.:
dead_letter_queue.enable: false
I've tried doing an strace on the config test when it hangs, but I just see the below constantly looping, so I'm not too sure what it's trying to do when it gets stuck:
strace -fp 19505
[pid 19505] futex(0x7f45d413ec54, FUTEX_WAIT_BITSET_PRIVATE, 1, {5129, 840252721}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
[pid 19505] futex(0x7f45d413ec28, FUTEX_WAKE_PRIVATE, 1) = 0
[pid 19505] clock_gettime(CLOCK_MONOTONIC, {5129, 840461101}) = 0
[pid 19505] clock_gettime(CLOCK_MONOTONIC, {5129, 840507583}) = 0
[pid 19505] clock_gettime(CLOCK_MONOTONIC, {5129, 840537435}) = 0
[pid 19505] clock_gettime(CLOCK_MONOTONIC, {5129, 840576137}) = 0
This has been tested on a fresh install/server
Any help would be greatly appreciated
Cheers,
Mike