I have installed logstash-5.2.2-1.noarch. Updated the config as follows:
input {
file {
path => "/var/log/tdrs/scf/*.xml"
sincedb_path => "/var/log/logstash/.sincedb"
type => "scf_xml"
start_position => "beginning"
codec => multiline {
pattern => "(^\s|</TdrType>)"
what => "previous"
}
}
}
filter {
strip the XML prolog and envelope to get the actual TDRs
if [message] =~ "<?xml" or [message] =~ "" or [message] =~ "</TDRS>" {
drop{}
}
xml {
source => "message"
target => "doc"
}
use the embedded Unix timestamp
date {
match => ["%{[doc][timestamp][0]}", "UNIX_MS"]
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "ngeag-tdrs-%{+YYYY.MM.dd}"
}
stdout { codec => rubydebug { metadata => true } }
}
This config yields the same result.
[root@leda-1 logstash]# bin/logstash -f /etc/logstash/conf.d/*.conf | more
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs to console
09:02:49.967 [[main]-pipeline-manager] INFO logstash.pipeline - Starting pipeline {"id"=>"main", "pipeline.workers"=>24, "pipeline.batch.size"=>125, "pi
peline.batch.delay"=>5, "pipeline.max_inflight"=>3000}
09:02:50.182 [[main]-pipeline-manager] INFO logstash.pipeline - Pipeline main started
09:02:50.242 [Api Webserver] INFO logstash.agent - Successfully started Logstash API endpoint {:port=>9602}
{
"path" => "/var/log/tdrs/scf/TDR.AES_1.SCF_1.ScfAgent_5.20160324.1351-UTC.xml",
"@timestamp" => 2017-03-23T14:08:33.842Z,
"@metadata" => {
"path" => "/var/log/tdrs/scf/TDR.AES_1.SCF_1.ScfAgent_5.20160324.1351-UTC.xml",
"host" => "leda-1"
},
"@version" => "1",
"host" => "leda-1",
"doc" => {
"corrID" => [
[0] "1458827492723_ea5b9d3d-ee7a-4966-850c-0131a3d2a9f5"
],
"subscriberID" => [
[0] "16308111111"
],
"dn" => [
[0] "AES_1.SCF_1.ScfAgent_5.EnablerNnsMMS_81"
],
"OrgName" => [
[0] "000-SLP009"
],
"eventType" => [
[0] "finalTrans"
],
"originator" => [
[0] "AES_1.SCF_1.ScfAgent_5.EnablerNnsMMS_81"
],
"version" => [
[0] "1.0"
],
"AppName" => [
[0] "SLP009-APP003"
],
"OrgId" => [
[0] "pl"
],
"flowDirection" => [
[0] "1"
],
"AppId" => [
[0] "a4x"
],
"operationType" => [
[0] "MMSEnabler_NotifyMessageReception"
],
"seqNumber" => [
[0] "4"
],
"timestamp" => [
[0] "1458827492860"
]
},
"message" => "\n finalTrans\n MMSEnabler_NotifyMessageReception\n AES_
1.SCF_1.ScfAgent_5.EnablerNnsMMS_81\n 1.0\n 1458827492860\n 4\n <corrID
1458827492723_ea5b9d3d-ee7a-4966-850c-0131a3d2a9f5\n AES_1.SCF_1.ScfAgent_5.EnablerNnsMMS_81\n 1<
/flowDirection>\n pl\n 000-SLP009\n a4x\n SLP009-APP003\n 16308111111\n",
"type" => "scf_xml",
"tags" => [
[0] "multiline"
]
}