# XML filter, doc\_as\_upsert and pipeline.workers

**URL:** <https://discuss.elastic.co/t/xml-filter-doc-as-upsert-and-pipeline-workers/182479>\
**Category:** Logstash\
**Created:** [May 23, 2019, 3:27pm UTC](https://discuss.elastic.co/t/xml-filter-doc-as-upsert-and-pipeline-workers/182479 "2019-05-23T15:27:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaryFu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maryfu/32/46724_2.png) [@MaryFu](https://discuss.elastic.co/u/MaryFu)\
**Post date:** [May 23, 2019, 3:27pm UTC](https://discuss.elastic.co/t/xml-filter-doc-as-upsert-and-pipeline-workers/182479/1 "2019-05-23T15:27:02Z")

</div>

Hello,

My colleague @Anabella_Cristaldi and me have an XML like the following structure

```
<animal>
    <h>feline</h>
                <h>meow</h>
                <p>
                               <property>
                                               <character>
                                               <breed>
                                               <age>
                               </property>
                               <cat name="gardfield">
                                               <c>good</c>
                                               <c>persian</c>
                                               <c>1year</c>
                               </cat>
                               <cat name="felix">
                                               <c>regular</c>
                                               <c>common</c>
                                               <c>3year</c>
                               </cat>
                               <cat name="misifu">
                                               <c>sweet</c>
                                               <c>common</c>
                                               <c>1year</c>
                               </cat>
                </p>
                <p>
                               <property>
                                               <height>
                               </property>
                               <cat name="gardfield">
                                               <c>3</c>
                               </cat>
                               <cat name="felix">
                                               <c>8</c>
                               </cat>
                               <cat name="misifu">
                                               <c>2</c>
                               </cat>
                </p>
</animal>

```

and we have an similar XML for dogs

We need to have in ES a document by animal with all the properties.  
We managed to do it using multine codec in the input plugin, xml and split filter plugin and in the output plugin action =\> "update" and doc\_as\_upsert =\> true and fix id for every cat/dog.  
Originally our pipeline.workers was set up to 3 but we have noticed that sometimes we had erratic results. In a cat document we had dog properties.  
Then we set the pipeline.workers to 1 and we have the expected results.

How pipeline.workers works and why we should use only one?

Thanks a lot!

PS: we use cats and dogs for simplicity, but we have data from network equipments in XML format

---

<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:** [June 20, 2019, 3:27pm UTC](https://discuss.elastic.co/t/xml-filter-doc-as-upsert-and-pipeline-workers/182479/2 "2019-06-20T15:27:09Z")

</div>

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