Load Multiple xml file from logstash into Elasticsearch

Dear All.
I am New Here please help me for below:-
iHow can load multiple xml from logstash into ES.

You will probably need to use a file input, possibly with a multiline codec, and then an xml filter. I suggest you read this thread. Search in this forum -- there are several explanations of how to do this.

1 Like

Dear All.
i am trying load single xml file from logstash to ES but going stuck with below error-
below my config file for logstash:-

input {
file {
path => "D:/RameshKumar/xmldata/es.xml"
sincedb_path => "NUL"
start_position => beginning
codec => multiline
{
pattern => "^<?xmldata .*>"
negate => true
what => "previous"
}
}
}
filter {
xml {
store_xml => false
source => "message"
xpath =>
[
"/xmldata/head1/id/text()", "id",
"/xmldata/head1/date/text()", "date",
"/xmldata/head1/key1/text()", "key1"
]
}

date {
match => [ "date" , "dd-MM-yyyy HH:mm:ss" ]
timezone => "Europe/Amsterdam"
}

}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "xmldata"
}
}

below is input xml file:-

alpha ramesh 0001 01-01-2016 09:00:00 prasanna

Plz help

Hi @Badger and team.
Please help me while trying to read multiple xml file getting below error please help me.
below is logstash:-
input {

file {

path => "D:/RameshKumar/xmldata/*.xml" #here multiple xml file contains
start_position => "beginning"
sincedb_path => "NUL"
type => "xml"

}
}
filter {
xml {
source => "message"
store_xml => false
xpath => [
"/xmldata/head1/id/text()", "id",
"/xmldata/head1/date/text()", "date",
"/xmldata/head1/key1/text()", "key1"
]
}

}
output {

elasticsearch {
hosts => ["localhost:9200"]
  index => "myxml-logs"
}

}

Please do not post pictures of text. Just post the text.

ok sorry.

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