# Outputting to several elastcisearch indeces

**URL:** https://discuss.elastic.co/t/outputting-to-several-elastcisearch-indeces/43123
**Category:** Logstash
**Created:** [March 1, 2016, 1:43pm UTC](https://discuss.elastic.co/t/outputting-to-several-elastcisearch-indeces/43123 "2016-03-01T13:43:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Igor\_Samusenko](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@Igor\_Samusenko](https://discuss.elastic.co/u/Igor_Samusenko)
#### Post date: [March 1, 2016, 1:43pm UTC](https://discuss.elastic.co/t/outputting-to-several-elastcisearch-indeces/43123/1 "2016-03-01T13:43:32Z")

</div>

I get JSON document to logstash. I write them to elasticsearch (it is log data).  
I'm wondering If I can write these documents to several elasticsearch indeces.

I'd like to write the whole documents to one index, and only certain fields to another.

Example:

> { user\_id : 12, user\_data: {some\_object}, timestamp: 123131323 }  
> To first index goes all fields (as it does right know).  
> To second index goes only user\_id and timestamp fields .

Is it possible ? Example of logstash.conf would be really great.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [March 1, 2016, 9:27pm UTC](https://discuss.elastic.co/t/outputting-to-several-elastcisearch-indeces/43123/2 "2016-03-01T21:27:41Z")

</div>

You will need to clone the events, then drop fields as appropriate and finally send them to their appropriate indices.

---

<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:09am UTC](https://discuss.elastic.co/t/outputting-to-several-elastcisearch-indeces/43123/3 "2017-07-06T05:09:02Z")

</div>


