# Logstash log4j2 plugins installation

**URL:** <https://discuss.elastic.co/t/logstash-log4j2-plugins-installation/133839>\
**Category:** Logstash\
**Created:** [May 30, 2018, 9:30am UTC](https://discuss.elastic.co/t/logstash-log4j2-plugins-installation/133839 "2018-05-30T09:30:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankita\_Ghate](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ankita\_Ghate](https://discuss.elastic.co/u/Ankita_Ghate)\
**Post date:** [May 30, 2018, 9:30am UTC](https://discuss.elastic.co/t/logstash-log4j2-plugins-installation/133839/1 "2018-05-30T09:30:53Z")

</div>

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:in`lookup'", "/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:in`plugin'", "(eval):8:in `<eval>'", "org/jruby/RubyKernel.java:994:in`eval'", "/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:in`initialize'", "/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:in`block 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:in`block in converge\_state'", "org/jruby/RubyArray.java:1734:in `each'", "/home/elk/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:299:in`converge\_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:in`with\_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:in`execute'", "/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:in`block in initialize'"]}

How to install logtash plugin log4j2 on ubuntu 14.04?

---

<div class="post-metadata">

**Author:** ![Ankita\_Ghate](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ankita\_Ghate](https://discuss.elastic.co/u/Ankita_Ghate)\
**Post date:** [May 30, 2018, 10:08am UTC](https://discuss.elastic.co/t/logstash-log4j2-plugins-installation/133839/2 "2018-05-30T10:08:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MrNerd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mrnerd/32/30763_2.png) [@MrNerd](https://discuss.elastic.co/u/MrNerd)\
**Post date:** [May 30, 2018, 1:35pm UTC](https://discuss.elastic.co/t/logstash-log4j2-plugins-installation/133839/3 "2018-05-30T13:35:19Z")

</div>

which version of java are you using @Ankita_Ghate ?

Regards

MrNerd

---

<div class="post-metadata">

**Author:** ![Ankita\_Ghate](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ankita\_Ghate](https://discuss.elastic.co/u/Ankita_Ghate)\
**Post date:** [May 31, 2018, 4:02am UTC](https://discuss.elastic.co/t/logstash-log4j2-plugins-installation/133839/4 "2018-05-31T04:02:58Z")

</div>

I am using java 8.

---

<div class="post-metadata">

**Author:** ![Ankita\_Ghate](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ankita\_Ghate](https://discuss.elastic.co/u/Ankita_Ghate)\
**Post date:** [June 1, 2018, 11:34am UTC](https://discuss.elastic.co/t/logstash-log4j2-plugins-installation/133839/5 "2018-06-01T11:34:11Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Ankita\_Ghate](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ankita\_Ghate](https://discuss.elastic.co/u/Ankita_Ghate)\
**Post date:** [June 6, 2018, 3:44pm UTC](https://discuss.elastic.co/t/logstash-log4j2-plugins-installation/133839/6 "2018-06-06T15:44:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ankita\_Ghate](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ankita\_Ghate](https://discuss.elastic.co/u/Ankita_Ghate)\
**Post date:** [June 13, 2018, 11:03am UTC](https://discuss.elastic.co/t/logstash-log4j2-plugins-installation/133839/7 "2018-06-13T11:03:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 11, 2018, 11:04am UTC](https://discuss.elastic.co/t/logstash-log4j2-plugins-installation/133839/8 "2018-07-11T11:04:14Z")

</div>

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