# Logstash - input/process/output XMLs to ElasticSearch - Java OutputStream

**URL:** <https://discuss.elastic.co/t/logstash-input-process-output-xmls-to-elasticsearch-java-outputstream/43086>\
**Category:** Logstash\
**Created:** [March 1, 2016, 8:27am UTC](https://discuss.elastic.co/t/logstash-input-process-output-xmls-to-elasticsearch-java-outputstream/43086 "2016-03-01T08:27:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paco\_B](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@Paco\_B](https://discuss.elastic.co/u/Paco_B)\
**Post date:** [March 1, 2016, 8:27am UTC](https://discuss.elastic.co/t/logstash-input-process-output-xmls-to-elasticsearch-java-outputstream/43086/1 "2016-03-01T08:27:53Z")

</div>

Hello,

I was wondering if there is a way to configure logstash as following:

- Java application sends a longer XML file by OutputStream to Logstash.
- Logstash "listens" over this outStream to receive, process and store it in ElasticSearch.

Many thanks.

Regards,  
Paco.

---

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [March 1, 2016, 8:37am UTC](https://discuss.elastic.co/t/logstash-input-process-output-xmls-to-elasticsearch-java-outputstream/43086/2 "2016-03-01T08:37:42Z")

</div>

You mean something to transform XML to JSON (what elasticsearch speaks)?

I think you can try this filter:

[https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html)

It should do the job!

---

<div class="post-metadata">

**Author:** ![Paco\_B](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@Paco\_B](https://discuss.elastic.co/u/Paco_B)\
**Post date:** [March 1, 2016, 8:43am UTC](https://discuss.elastic.co/t/logstash-input-process-output-xmls-to-elasticsearch-java-outputstream/43086/3 "2016-03-01T08:43:29Z")

</div>

Many thanks ebuildy,

No, I mean to be "listening" from Logstash any event in a opened OutputStream in Java. I don't want to read from Files, I want to read from outputStream that comes from Java -\> Get it by Logstash -\> Process it by XML plugin (as you told me before) -\> Store it by ElasticSearch.

So, my question is about the first "connection": between my Java application and Logstash input plugin, if there is a plugin which reads streams from a Java Application.

Many thanks.

Regards,  
Paco.

---

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [March 1, 2016, 8:51am UTC](https://discuss.elastic.co/t/logstash-input-process-output-xmls-to-elasticsearch-java-outputstream/43086/4 "2016-03-01T08:51:54Z")

</div>

Logstash has some input plugins:

- TCP
- HTTP
- UDP
- RabbitMQ
- File

And filter

- XML

And output:

- ElasticSearch

From your Java, you can communicate with LogStash via TCP or HTTP easily I am sure. If you want HA, use a queue like RabbitMQ or Kafka between Java and LogStash.

---

<div class="post-metadata">

**Author:** ![Paco\_B](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@Paco\_B](https://discuss.elastic.co/u/Paco_B)\
**Post date:** [March 3, 2016, 2:24pm UTC](https://discuss.elastic.co/t/logstash-input-process-output-xmls-to-elasticsearch-java-outputstream/43086/5 "2016-03-03T14:24:06Z")

</div>

Many thanks 🙂

---

<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:08am UTC](https://discuss.elastic.co/t/logstash-input-process-output-xmls-to-elasticsearch-java-outputstream/43086/6 "2017-07-06T05:08:31Z")

</div>


