# Store XML file on S3 and send specific XML TAGs to ElasticSearch to index

**URL:** <https://discuss.elastic.co/t/store-xml-file-on-s3-and-send-specific-xml-tags-to-elasticsearch-to-index/154941>\
**Category:** Logstash\
**Created:** [October 31, 2018, 11:03pm UTC](https://discuss.elastic.co/t/store-xml-file-on-s3-and-send-specific-xml-tags-to-elasticsearch-to-index/154941 "2018-10-31T23:03:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![costamarcelo](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@costamarcelo](https://discuss.elastic.co/u/costamarcelo)\
**Post date:** [October 31, 2018, 11:03pm UTC](https://discuss.elastic.co/t/store-xml-file-on-s3-and-send-specific-xml-tags-to-elasticsearch-to-index/154941/1 "2018-10-31T23:03:06Z")

</div>

Hi folks

Can I use LogStash to sent only some TAGs from an XML file and store the physical XML file on an S3?

```
                                  |----> ElasticSearch
                                  |

```

XML --\> LogStash --\>|  
|  
|----\> S3

From the XML file, I need sending to ElasticSearch index only some specific TAGS.

To the S3 storage, I need send the complete XML file. In that case, I can not transform the XML file to JSON due to a government rule. I need store this file in the original XML format without changes.

The XML file is in a directory on my disk local.

I need store this files on an S3 due to when requested, the user can search on ElasticSeacrh and download the physical file from S3 by a Webpage that I will create.

Anyone with a similar situation?

* * *

My output on LogStash Conf file:

output {

#testing with a local file

stdout  
{  
codec =\> rubydebug  
}

elasticsearch

{

hosts ="MY ElasticSearch Host";

user ="elastictem";

password ="My Password";

index ="xmlTest";

}

s3{

access\_key\_id ="My Access Key";

secret\_access\_key ="My Secret Access Key";

region ="us-east-1";

bucket ="Testxml1";

time\_file = 1

}

---

<div class="post-metadata">

**Author:** ![Mike.Barretta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike.barretta/32/16688_2.png) [@Mike.Barretta](https://discuss.elastic.co/u/Mike.Barretta)\
**Post date:** [November 1, 2018, 2:20pm UTC](https://discuss.elastic.co/t/store-xml-file-on-s3-and-send-specific-xml-tags-to-elasticsearch-to-index/154941/2 "2018-11-01T14:20:00Z")

</div>

@costamarcelo  
Maybe checkout the [clone filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-clone.html).

If you clone incoming docs and use `add_tag` to differentiate them (e.g. `add\_tag =\> "original"), then you can have [conditional logic](https://www.elastic.co/guide/en/logstash/current/config-examples.html#using-conditionals) in your pipeline to do different things with each: original goes to s3 and the other is stripped of unnecessary bits and output to Elasticsearch.

---

<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:** [November 29, 2018, 2:20pm UTC](https://discuss.elastic.co/t/store-xml-file-on-s3-and-send-specific-xml-tags-to-elasticsearch-to-index/154941/3 "2018-11-29T14:20:13Z")

</div>

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