# JBoss EAP 6.4 and Logstash using log4j

**URL:** <https://discuss.elastic.co/t/jboss-eap-6-4-and-logstash-using-log4j/74286>\
**Category:** Logstash\
**Created:** [February 7, 2017, 8:37pm UTC](https://discuss.elastic.co/t/jboss-eap-6-4-and-logstash-using-log4j/74286 "2017-02-07T20:37:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![skiss](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@skiss](https://discuss.elastic.co/u/skiss)\
**Post date:** [February 7, 2017, 8:37pm UTC](https://discuss.elastic.co/t/jboss-eap-6-4-and-logstash-using-log4j/74286/1 "2017-02-07T20:37:54Z")

</div>

I am trying to consolidate my Jboss logs into ElasticSearch via Logstash (log4j).

So far:

- I've built and installed logstash-input-log4j plugin ([https://www.elastic.co/guide/en/logstash/current/plugins-inputs-log4j.html](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-log4j.html)) in logstash-5.1.1.

- Configured Jboss:  
custom-handler name="Remotelog4j" class="org.apache.log4j.net.SocketAppender" module="org.apache.log4j"  
\<level name="INFO"/  
properties  
property name="RemoteHost" value="localhost"  
property name="Port" value="4560"  
property name="LocationInfo" value="true"  
properties  
custom-handler

-Configured Logstash:  
input {  
\# file {  
\# path =\> "/serverpath/log/server.log"  
\# start\_position =\> "beginning"  
\# }  
log4j {  
mode =\> "server"  
host =\> "0.0.0.0"  
port =\> 4560  
type =\> "log4j"  
}  
}

filter {  
if [path] =~ "access" {  
mutate { replace =\> { "type" =\> "apache\_access" } }  
grok {  
match =\> { "message" =\> "%{COMBINEDAPACHELOG}" }  
}  
}  
date {  
match =\> ["timestamp" , "dd/MMM/yyyy:HH:mm:ss Z"]  
}  
}

output {  
elasticsearch {  
hosts =\> ["elasticsearchserver:9200"]  
}  
stdout { codec =\> rubydebug }  
}

(\*)the commented out option (file) works in the Logstash. The problem is that I couldn't make it working with log4j type input. No error or clue but the log entries are not showing up in ElasticSearch.

---

<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:** [March 7, 2017, 8:38pm UTC](https://discuss.elastic.co/t/jboss-eap-6-4-and-logstash-using-log4j/74286/2 "2017-03-07T20:38:14Z")

</div>

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