Logstash log4j2 plugins installation

while starting logstash, I am getting below error,

83][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.2.2"}
[2018-05-30T09:14:47,157][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9618}
[2018-05-30T09:14:49,683][ERROR][logstash.plugins.registry] Tried to load a plugin's code, but failed. {:exception=>#<LoadError: no such file to load -- logstash/inputs/log4j2>, :path=>"logstash/inputs/log4j2", :type=>"input", :name=>"log4j2"}
[2018-05-30T09:14:49,726][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::PluginLoading**Error", :message=>"Couldn't find any input plugin named 'log4j2'. Are you sure this is correct? Trying to load the log4j2 input plugin resulted in this error: no such file to load -- logstash/inputs/log4j2", :backtrace=>["/home/elk/logstash-6.2.2/logstash-core/lib/logstash/plugins/registry.rb:192:in lookup_pipeline_plugin'", "/home/elk/logstash-6.2.2/logstash-**core/lib/logstash/plugin.rb:140:inlookup'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/plugins/plugin_factory.rb:81:in plugin'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/pipeline.rb:112:inplugin'", "(eval):8:in <eval>'", "org/jruby/RubyKernel.java:994:ineval'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/pipeline.rb:84:in initialize'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/pipeline.rb:169:ininitialize'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/pipeline_action/create.rb:40:in execute'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:315:inblock in converge_state'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:141:in with_pipelines'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:312:inblock in converge_state'", "org/jruby/RubyArray.java:1734:in each'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:299:inconverge_state'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:166:in block in converge_state_and_update'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:141:inwith_pipelines'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:164:in converge_state_and_update'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:90:inexecute'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/runner.rb:348:in block in execute'", "/home/elk/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:inblock in initialize'"]}

How to install logtash plugin log4j2 on ubuntu 14.04?

Getting below error while installing plugin,

./logstash-plugin install logstash-input-log4j2
Validating logstash-input-log4j2
Installing logstash-input-log4j2
Plugin version conflict, aborting
ERROR: Installation Aborted, message: Bundler could not find compatible versions for gem "logstash-core":
In snapshot (Gemfile.lock):
logstash-core (= 6.2.2)

In Gemfile:
logstash-core-plugin-api (>= 0) java depends on
logstash-core (= 6.2.2) java

logstash-input-syslog (>= 0) java depends on
  logstash-filter-grok (>= 0) java depends on
    logstash-core (>= 5.6.0) java

logstash-input-log4j2 (>= 0) java depends on
  logstash-core (< 2.0.0, >= 1.4.0) java

logstash-core (>= 0) java

Running bundle update will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Bundler could not find compatible versions for gem "logstash":
In Gemfile:
logstash-input-log4j2 (>= 0) java depends on
logstash (< 2.0.0, >= 1.4.0) java
Could not find gem 'logstash (< 2.0.0, >= 1.4.0) java', which is required by gem 'logstash-input-log4j2 (>= 0) java', in any of the sources.

which version of java are you using @Ankita_Ghate ?

Regards

MrNerd

I am using java 8.

Getting below error,
bin/logstash-plugin install vendor/bundle/jruby/2.3.0/gems/logstash-log4j2/logstash-input-log4j2-5.2-java.gem
Validating vendor/bundle/jruby/2.3.0/gems/logstash-log4j2/logstash-input-log4j2-5.2-java.gem
Installing logstash-input-log4j2
Plugin version conflict, aborting
ERROR: Installation Aborted, message: Bundler could not find compatible versions for gem "logstash-core":
In snapshot (Gemfile.lock):
logstash-core (= 6.2.2)

In Gemfile:
logstash-input-log4j2 (= 5.2) java depends on
logstash-core (< 3.0.0, >= 2.0.0.beta2) java

logstash-core (>= 0) java

Running bundle update will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

So I install logstashs-core version 2.0.0.beta2. Then getting below error,

bin/logstash-plugin install vendor/bundle/jruby/2.3.0/gems/logstash-log4j2/logstash-input-log4j2-5.2-java.gem
Validating vendor/bundle/jruby/2.3.0/gems/logstash-log4j2/logstash-input-log4j2-5.2-java.gem
Installing logstash-input-log4j2
Plugin version conflict, aborting
ERROR: Installation Aborted, message: Bundler could not find compatible versions for gem "logstash-core":
In Gemfile:
logstash-input-log4j2 (= 5.2) java depends on
logstash-core (< 3.0.0, >= 2.0.0.beta2) java

logstash-core-plugin-api (>= 0) java depends on
  logstash-core (= 2.0.0.beta2) java

logstash-filter-grok (>= 0) java depends on
  logstash-core (>= 5.6.0) java

logstash-core (>= 0) java

How do I maintain different versions ?

Can anybody tell whether logstash-input-log4j2 plugin is also deprecated or what else is the issue?

Getting below error while starting logstash input plugin log4j2,

bin/logstash -f logstash.conf
Sending Logstash logs to /home/admin1/elkstack/logstash/logs which is now configured via log4j2.properties
[2018-06-13T15:32:03,848][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2018-06-13T15:32:03,999][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.0.0-alpha1"}
[2018-06-13T15:32:04,394][INFO ][logstash.javapipeline ] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>500, :thread=>"#<Thread:0x5628c0cb@/home/admin1/elkstack/logstash/logstash-core/lib/logstash/java_pipeline.rb:136 run>"}
[2018-06-13T15:32:04,461][ERROR][logstash.agent ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create, action_result: false", :backtrace=>nil}
[2018-06-13T15:32:04,517][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (LoadError) no such file to load -- /home/admin1/elkstack/logstash/logstash-core/vendor/log4j-core-2.1

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