# Create a config file \[xml\] for LOGSTASH

**URL:** <https://discuss.elastic.co/t/create-a-config-file-xml-for-logstash/162216>\
**Category:** Elasticsearch\
**Created:** [December 27, 2018, 9:22am UTC](https://discuss.elastic.co/t/create-a-config-file-xml-for-logstash/162216 "2018-12-27T09:22:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alaoui](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Alaoui](https://discuss.elastic.co/u/Alaoui)\
**Post date:** [December 27, 2018, 9:22am UTC](https://discuss.elastic.co/t/create-a-config-file-xml-for-logstash/162216/1 "2018-12-27T09:22:39Z")

</div>

Hi guys , im new in elasticsearch and logstash and i would like to create the config file for logstash that he can load the xml file data , so i can do the searching in elasticsearch using kibana , i realy appreciate this help if anyone can help me to create this config .

The xml file structure is :

```
  <?xml version="1.0" encoding="ISO-8859-15"?>

  <ORDERS>
  <ORDER>
 <COMPANY_CODE>CHU</COMPANY_CODE>
 <ETABLISSEMENET_CODE>CHU</ETABLISSEMENET_CODE>
 <FOURNISSEUR>BI</FOURNISSEUR>
 <DESTINATAIRE>CHUSUDRUN2</DESTINATAIRE>
 <NUM_COMMANDE_MYTOWER>342</NUM_COMMANDE_MYTOWER>
 <NUM_COMMANDE_CHU>CMD12345</NUM_COMMANDE_CHU>
 <INSTRUCTIONS>COLIS</INSTRUCTIONS>
 <ETAT>4</ETAT>
 <DATE_DE_COMMANDE>01-01-2018</DATE_DE_COMMANDE>
 <DATE_DE_DISPONIBILITE>01-01-2018</DATE_DE_DISPONIBILITE>
 <MONTANT_HT>3695.0</MONTANT_HT>
 <DATE_DE_CREATION></DATE_DE_CREATION>
 <POIDS_BRUT>20.0</POIDS_BRUT>
 <NOMBRE_COLIS>3</NOMBRE_COLIS>
 </ORDER>
 </ORDERS>
```

---

<div class="post-metadata">

**Author:** ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)\
**Post date:** [December 27, 2018, 9:41am UTC](https://discuss.elastic.co/t/create-a-config-file-xml-for-logstash/162216/2 "2018-12-27T09:41:19Z")

</div>

hope this helps you,

> [@Unable to load xml file in logstash](https://discuss.elastic.co/t/unable-to-load-xml-file-in-logstash/151318/5):
>
> The correct output is obtained for below input code, hope this helps other people, Also, max\_lines number changes based on the maximum number of lines present in your xml file input { file { path =\> "C:/Users/LENOVO/Downloads/stations.xml" start\_position =\> "beginning" sincedb\_path =\> "NUL" codec =\> multiline { pattern =\> "^\<?stations.\*\>" negate =\> "true" what =\> "previous" auto\_flush\_interval =\> 1 max\_lines =\> 3000 } } } filter { xml { source =\> "message" target =\> "pars…

Regards

---

<div class="post-metadata">

**Author:** ![Alaoui](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Alaoui](https://discuss.elastic.co/u/Alaoui)\
**Post date:** [December 27, 2018, 9:44am UTC](https://discuss.elastic.co/t/create-a-config-file-xml-for-logstash/162216/3 "2018-12-27T09:44:37Z")

</div>

so im gonna copy and modify the config file in this example right ?

---

<div class="post-metadata">

**Author:** ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)\
**Post date:** [December 27, 2018, 9:48am UTC](https://discuss.elastic.co/t/create-a-config-file-xml-for-logstash/162216/4 "2018-12-27T09:48:58Z")

</div>

yes i have updated you with the sample example, so you can try with your xml.

---

<div class="post-metadata">

**Author:** ![Alaoui](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Alaoui](https://discuss.elastic.co/u/Alaoui)\
**Post date:** [December 27, 2018, 2:23pm UTC](https://discuss.elastic.co/t/create-a-config-file-xml-for-logstash/162216/5 "2018-12-27T14:23:41Z")

</div>

i will try it thanks anyway

---

<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:** [January 24, 2019, 2:24pm UTC](https://discuss.elastic.co/t/create-a-config-file-xml-for-logstash/162216/6 "2019-01-24T14:24:00Z")

</div>

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