# Importing more than one xml file

**URL:** <https://discuss.elastic.co/t/importing-more-than-one-xml-file/126534>\
**Category:** Logstash\
**Created:** [April 3, 2018, 9:04am UTC](https://discuss.elastic.co/t/importing-more-than-one-xml-file/126534 "2018-04-03T09:04:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EloaCardoso](https://avatars.discourse-cdn.com/v4/letter/e/7cd45c/32.png) [@EloaCardoso](https://discuss.elastic.co/u/EloaCardoso)\
**Post date:** [April 3, 2018, 9:04am UTC](https://discuss.elastic.co/t/importing-more-than-one-xml-file/126534/1 "2018-04-03T09:04:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Suman\_Reddy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suman_reddy1/32/27303_2.png) [@Suman\_Reddy1](https://discuss.elastic.co/u/Suman_Reddy1)\
**Post date:** [April 3, 2018, 1:48pm UTC](https://discuss.elastic.co/t/importing-more-than-one-xml-file/126534/2 "2018-04-03T13:48:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![EloaCardoso](https://avatars.discourse-cdn.com/v4/letter/e/7cd45c/32.png) [@EloaCardoso](https://discuss.elastic.co/u/EloaCardoso)\
**Post date:** [April 4, 2018, 7:30am UTC](https://discuss.elastic.co/t/importing-more-than-one-xml-file/126534/3 "2018-04-04T07:30:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![EloaCardoso](https://avatars.discourse-cdn.com/v4/letter/e/7cd45c/32.png) [@EloaCardoso](https://discuss.elastic.co/u/EloaCardoso)\
**Post date:** [April 4, 2018, 7:32am UTC](https://discuss.elastic.co/t/importing-more-than-one-xml-file/126534/4 "2018-04-04T07:32:54Z")

</div>

I am using Logstash 5.5.2

---

<div class="post-metadata">

**Author:** ![EloaCardoso](https://avatars.discourse-cdn.com/v4/letter/e/7cd45c/32.png) [@EloaCardoso](https://discuss.elastic.co/u/EloaCardoso)\
**Post date:** [April 4, 2018, 9:10am UTC](https://discuss.elastic.co/t/importing-more-than-one-xml-file/126534/6 "2018-04-04T09:10:02Z")

</div>

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... 😥

---

<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:** [May 2, 2018, 9:13am UTC](https://discuss.elastic.co/t/importing-more-than-one-xml-file/126534/7 "2018-05-02T09:13:40Z")

</div>

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