Logstash Configuration Error in K8

Hi Team,

Created a Pod for logstash and I am trying to solve the below error. Requesting your help for the same.

[ERROR] 2020-07-31 04:48:57.595 [Converge PipelineAction::Create<main>] agent - Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [ \\t\\r\\n], \"#\", \"input\", \"filter\", \"output\" at line 1, column 1 (byte 1)", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:58:in `compile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:66:in `compile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:28:in `block in compile_sources'", "org/jruby/RubyArray.java:2577:in `map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:27:in `compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:181:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:67:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:43:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:52:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:342:in `block in converge_state'"]}
[INFO ] 2020-07-31 04:48:57.683 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=>9600}
[INFO ] 2020-07-31 04:49:02.704 [LogStash::Runner] runner - Logstash shut down.

Contents of the pipeline folder

bash-4.2$   ls -al /usr/share/logstash/pipeline
total 12
drwxrwxrwx 3 root     root 4096 Jul 31 05:08 .
drwxrwsr-x 1 logstash root 4096 Jun 14 21:40 ..
drwxr-xr-x 2 root     root 4096 Jul 31 05:08 ..2020_07_31_05_08_32.041534970
lrwxrwxrwx 1 root     root   31 Jul 31 05:08 ..data -> ..2020_07_31_05_08_32.041534970
lrwxrwxrwx 1 root     root   29 Jul 31 05:08 http-input-plugin.conf -> ..data/http-input-plugin.conf
lrwxrwxrwx 1 root     root   20 Jul 31 05:08 removeKeys.rb -> ..data/removeKeys.rb
bash-4.2$   ls -al

logstash is configured with http plugin.

It claims that there is a syntax error in your configuration. If you are sure that there is none, check this list of potential causes:

I have resolved that error and the logstash pod, fails to run because of GemSpecError. Hoping for some more guidance.

root@master-node:~# kubectl logs logstash-deployment-5fb6d78576-j6lnw
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules (file:/usr/share/logstash/logstash-core/lib/jars/jruby-complete-9.2.11.1.jar) to method sun.nio.ch.NativeThread.signal(long)
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
/usr/share/logstash/logstash-core-plugin-api/lib/logstash-core-plugin-api/version.rb:22: warning: The Psych YAML extension failed to load.
Check your env for conflicting versions of SnakeYAML
See https://github.com/jruby/jruby/wiki/FAQs#why-does-the-psych-yaml-extension-fail-to-load-in-my-environment
[ERROR] 2020-08-03 15:40:44.363 [main] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (GemspecError)
[!] There was an error while loading `logstash-core-plugin-api.gemspec`: load error: psych -- java.lang.RuntimeException: BUG: we can not copy embedded jar to temp directory
Does it try to require a relative path? That's been removed in Ruby 1.9. Bundler cannot continue.

 #  from /usr/share/logstash/logstash-core-plugin-api/logstash-core-plugin-api.gemspec:23
 #  -------------------------------------------
 #
 >  require "logstash-core-plugin-api/version"
 #
 #  -------------------------------------------

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