Importing more than one xml file

Hi,

I would like to know how I can import more than one xml file from logstash to elasticsearch.
My configuration file is working just for the importing of one xml file.
The input filter is written as follows:

input {
  file {
    path => ["path-to-xml-file\payload_4_1.xml"]
    start_position => "beginning"
    ignore_older => 0 
    sincedb_path => "/dev/null"
	
    codec => multiline {
      pattern => "^\s|^[A-Za-z].*|^[[:alpha:]]|\."
      what => "next"
    }
  }
}

if I change the path to:

path => ["path-to-xml-file\*.xml"]

elasticsearch gets no data.
Can anyone help me please?

Are the different XML file contents are matching to the multiline codec pattern you are using ?
Initially try removing multiline, if logstash is able to read then apply multiline

input{
file{
path => "C:/Users/ELK/logstash-6.2.2/config/*.xml"
start_position => "beginning"
}
}

output{

stdout {}
}

Above worked for me.

Hi @Suman_Reddy1,

thank you for your answer.

the content of the different xml files is the same.

I removed the multiline codec and logstash was able to read it, but not correctly. At least there was no error in the pipeline.

The problem continues.

I am using Logstash 5.5.2

I found the answer.

I changed backslash to slash in the path:

input {
  file {
    path => ["path-to-xml-file/*.xml"]
    ...

Then it worked.

Almost two days... :disappointed_relieved:

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