# How to divide XML data into two fields

**URL:** <https://discuss.elastic.co/t/how-to-divide-xml-data-into-two-fields/94301>\
**Category:** Logstash\
**Created:** [July 24, 2017, 10:07am UTC](https://discuss.elastic.co/t/how-to-divide-xml-data-into-two-fields/94301 "2017-07-24T10:07:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhisek](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhisek](https://discuss.elastic.co/u/abhisek)\
**Post date:** [July 24, 2017, 10:07am UTC](https://discuss.elastic.co/t/how-to-divide-xml-data-into-two-fields/94301/1 "2017-07-24T10:07:40Z")

</div>

I have a XML data which gets loaded in logstash and it looks like this in kibana.

```
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.lookup.sdp.bharti.ibm.com">
<soapenv:Header/>
<soapenv:Body>
<web:getLookUpServiceDetails>
<getLookUpService>
<serviceRequester>iOBD</serviceRequester>
<lineOfBusiness>mobility</lineOfBusiness>
</getLookUpService>
</web:getLookUpServiceDetails>
</soapenv:Body>
</soapenv:Envelope><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:getLookUpServiceDetailsResponse xmlns:ns="http://webservices.lookup.sdp.bharti.ibm.com">
<getLookUpServiceReturn>
<errorInfo>
<ErrorCode/>
<ErrorMessage/>
</errorInfo>
</soapenv:Envelope>

```

and i want to divide the whole XML data into two fields.

My required output :

```
Request = <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.lookup.sdp.bharti.ibm.com">
    <soapenv:Header/>
    <soapenv:Body>
    <web:getLookUpServiceDetails>
    <getLookUpService>
    <serviceRequester>iOBD</serviceRequester>
    <lineOfBusiness>mobility</lineOfBusiness>
    </getLookUpService>
    </web:getLookUpServiceDetails>
    </soapenv:Body>
    </soapenv:Envelope>

 Response = <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <ns:getLookUpServiceDetailsResponse xmlns:ns="http://webservices.lookup.sdp.bharti.ibm.com">
    <getLookUpServiceReturn>
    <errorInfo>
    <ErrorCode/>
    <ErrorMessage/>
    </errorInfo>
    </soapenv:Envelope>
```

---

<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:** [August 21, 2017, 10:07am UTC](https://discuss.elastic.co/t/how-to-divide-xml-data-into-two-fields/94301/2 "2017-08-21T10:07:54Z")

</div>

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