# Multiple indices per document

**URL:** <https://discuss.elastic.co/t/multiple-indices-per-document/18776>\
**Category:** Elasticsearch\
**Created:** [July 21, 2014, 11:33pm UTC](https://discuss.elastic.co/t/multiple-indices-per-document/18776 "2014-07-21T23:33:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prakash](https://avatars.discourse-cdn.com/v4/letter/p/3be4f8/32.png) [@Prakash](https://discuss.elastic.co/u/Prakash)\
**Post date:** [July 21, 2014, 11:33pm UTC](https://discuss.elastic.co/t/multiple-indices-per-document/18776/1 "2014-07-21T23:33:54Z")

</div>

I want to use ES to index logs coming from different processes. Assume I  
have 2 sources: ProcessA and ProcessB Logs from the processes are formatted  
in json. Example log:

{"level":"DEBUG","logger":"REPOSITORY","timestamp":1405982400689,"attrs":{"profile":"ManagementServerA","organization":"FOOBAR"},"thread":"main","message":"Repository.store() : Stored successfully in /central/zone/cef9cccab964"}

How can I get ES to update multiple indexes when it sees a new document ?  
In this case I want indices on the profile and organization values. Do I  
have to

1. Create indexes using the ES REST api before ES sees any logs.
2. Supply an \_index field to each json document
3. Have multiple values in the \_index field to indicate what indexes  
must be updated ? i.e should I have: _"\_index": {"ManagementServerA" ,  
"FOOBAR"}_

Please let me know if this is the correct way to do this.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c299f3e4-eebc-43a4-ab23-894605b2a752%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c299f3e4-eebc-43a4-ab23-894605b2a752%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:14am UTC](https://discuss.elastic.co/t/multiple-indices-per-document/18776/2 "2017-07-06T01:14:23Z")

</div>


