# Can logstash output an XML file?

**URL:** <https://discuss.elastic.co/t/can-logstash-output-an-xml-file/32300>\
**Category:** Logstash\
**Created:** [October 15, 2015, 4:40pm UTC](https://discuss.elastic.co/t/can-logstash-output-an-xml-file/32300 "2015-10-15T16:40:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![piyush.m82](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@piyush.m82](https://discuss.elastic.co/u/piyush.m82)\
**Post date:** [October 15, 2015, 4:40pm UTC](https://discuss.elastic.co/t/can-logstash-output-an-xml-file/32300/1 "2015-10-15T16:40:42Z")

</div>

Hello Guys,

I am fairly new to logstash and want to know few things before implementing anything further.  
I have a requirement to write into logstash, logs which are in json format and then logstash should output an xml file to be consumed by a second system which understands xml.  
So can logstash parse json and output an xml file out of this json file?

To give some more information here is what I need:  
Virtual Machine \>\> writes json to logstash-forwarder \>\> logstash consumes this json \>\> logstash parses this information and produces an xml output

or

Virtual Machine \>\> writes json to logstash \>\> logstash parses this information and produces an xml output

what is the best way we can do this?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 15, 2015, 5:47pm UTC](https://discuss.elastic.co/t/can-logstash-output-an-xml-file/32300/2 "2015-10-15T17:47:51Z")

</div>

I don't know of an XML codec for Logstash. Your best option might be to use the exec or pipe output to feed the message as e.g. JSON to a separate program that converts it to XML.

---

<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 6, 2017, 5:26am UTC](https://discuss.elastic.co/t/can-logstash-output-an-xml-file/32300/3 "2017-07-06T05:26:24Z")

</div>

Closed on July 6, 2017, 5:26am UTC


