# Load Multiple xml file from logstash into Elasticsearch

**URL:** <https://discuss.elastic.co/t/load-multiple-xml-file-from-logstash-into-elasticsearch/184886>\
**Category:** Logstash\
**Created:** [June 9, 2019, 6:20pm UTC](https://discuss.elastic.co/t/load-multiple-xml-file-from-logstash-into-elasticsearch/184886 "2019-06-09T18:20:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rameshkr1994](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshkr1994/32/59029_2.png) [@rameshkr1994](https://discuss.elastic.co/u/rameshkr1994)\
**Post date:** [June 9, 2019, 6:20pm UTC](https://discuss.elastic.co/t/load-multiple-xml-file-from-logstash-into-elasticsearch/184886/1 "2019-06-09T18:20:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 10, 2019, 12:03am UTC](https://discuss.elastic.co/t/load-multiple-xml-file-from-logstash-into-elasticsearch/184886/2 "2019-06-10T00:03:12Z")

</div>

You will probably need to use a [file](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html) input, possibly with a multiline codec, and then an [xml](https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html) filter. I suggest you read [this](https://discuss.elastic.co/t/parsing-xml-log-file-with-logstash/167306) thread. Search in this forum -- there are several explanations of how to do this.

---

<div class="post-metadata">

**Author:** ![rameshkr1994](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshkr1994/32/59029_2.png) [@rameshkr1994](https://discuss.elastic.co/u/rameshkr1994)\
**Post date:** [June 10, 2019, 7:39am UTC](https://discuss.elastic.co/t/load-multiple-xml-file-from-logstash-into-elasticsearch/184886/3 "2019-06-10T07:39:05Z")

</div>

## 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

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/0/c024804eeaa5268150db2fca7f73e880e3d4cb99.png)

---

<div class="post-metadata">

**Author:** ![rameshkr1994](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshkr1994/32/59029_2.png) [@rameshkr1994](https://discuss.elastic.co/u/rameshkr1994)\
**Post date:** [June 10, 2019, 10:13am UTC](https://discuss.elastic.co/t/load-multiple-xml-file-from-logstash-into-elasticsearch/184886/4 "2019-06-10T10:13:10Z")

</div>

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"
}

```

}

 ![ESMULTIPLE](https://us1.discourse-cdn.com/elastic/original/3X/f/1/f1b2967963dbc3bebf27552736de4361add56649.png)

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 10, 2019, 1:44pm UTC](https://discuss.elastic.co/t/load-multiple-xml-file-from-logstash-into-elasticsearch/184886/5 "2019-06-10T13:44:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rameshkr1994](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshkr1994/32/59029_2.png) [@rameshkr1994](https://discuss.elastic.co/u/rameshkr1994)\
**Post date:** [June 10, 2019, 2:25pm UTC](https://discuss.elastic.co/t/load-multiple-xml-file-from-logstash-into-elasticsearch/184886/6 "2019-06-10T14:25:41Z")

</div>

ok sorry.

---

<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:** [July 8, 2019, 2:25pm UTC](https://discuss.elastic.co/t/load-multiple-xml-file-from-logstash-into-elasticsearch/184886/7 "2019-07-08T14:25:41Z")

</div>

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