Hi,
This is a follow up to an earlier post on a similar topic.
I'm trying to send Log4j logs in XML format to Elasticsearch using Logstash.
My XML file is:
<log4j:event logger="Common.Core.Sessions.SessionManager" level="INFO" timestamp="1567418641859" thread="8">
<log4j:message> Session fb9d3408-d370 created for user {9131559e-3b0b} at 127.0.0.1:4931</log4j:message>
<log4j:properties>
<log4j:data name="ConnectionId" value="0HLPFHJFNA3PK" />
<log4j:data name="RequestId" value="0HLPFHJFNA3PK:00000007" />
</log4j:properties>
</log4j:event>
and logstash.conf file is:
input {
beats {
port => 5044
type => "log"
}
}
filter
{
xml
{
source => "message"
xpath =>
[
"/log4j:event/log4j:message/text()", "messageMES"
]
store_xml => true
target => "doc"
}
}
output {
elasticsearch {
hosts => "localhost:9200"
sniffing => true
manage_template => false
index => "%{[@metadata][beat]}-%{+yyyy.ww}"
document_type => "%{[@metadata][type]}"
}
}
My Filebeat config (partially) is:
filebeat.inputs:
- type: log
enabled: true
paths:
- C:\ProgramData\LogTest\*.xml
#Multiline options
multiline.pattern: '^<log4j:event'
multiline.negate: true
multiline.match: after
The issue is that all the services start correctly and I do not see any errors in any log files, but the message that I've captured from the XML file ( "Session fb9d3408-d370 created for user {9131559e-3b0b} at 127.0.0.1:4931" ) does not show up in the Kibana logs.
Is there anything wrong in the configs? Or is there something else ?
Thanks in advance,
Jy