# Data in different indexes depending of a field

**URL:** https://discuss.elastic.co/t/data-in-different-indexes-depending-of-a-field/11187
**Category:** Elasticsearch
**Created:** [March 18, 2013, 9:45am UTC](https://discuss.elastic.co/t/data-in-different-indexes-depending-of-a-field/11187 "2013-03-18T09:45:48Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Voyager](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/voyager/32/2431_2.png) [@Voyager](https://discuss.elastic.co/u/Voyager)
#### Post date: [March 18, 2013, 9:45am UTC](https://discuss.elastic.co/t/data-in-different-indexes-depending-of-a-field/11187/1 "2013-03-18T09:45:48Z")

</div>

How can I put data from one source to different indexes depending of a  
field? Let say I have some data and I want to put it in two different  
indexes depending of timestamp.  
And if it possible to make this from mappping.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)
#### Post date: [March 18, 2013, 11:03am UTC](https://discuss.elastic.co/t/data-in-different-indexes-depending-of-a-field/11187/2 "2013-03-18T11:03:18Z")

</div>

On Mon, 2013-03-18 at 02:45 -0700, Voyager wrote:

> How can I put data from one source to different indexes depending of a  
> field? Let say I have some data and I want to put it in two different  
> indexes depending of timestamp.  
> And if it possible to make this from mappping.

You need to handle this in your application

clint

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Voyager](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/voyager/32/2431_2.png) [@Voyager](https://discuss.elastic.co/u/Voyager)
#### Post date: [March 18, 2013, 11:16am UTC](https://discuss.elastic.co/t/data-in-different-indexes-depending-of-a-field/11187/3 "2013-03-18T11:16:20Z")

</div>

I know that, but I'm asking if there is another solution, because I can't  
do it from my source application. One solution is to have a script between  
source application, which is not my application, and elasticsearch, but I'm  
searching for a better and easier solution.

On Monday, March 18, 2013 1:03:18 PM UTC+2, Clinton Gormley wrote:

> On Mon, 2013-03-18 at 02:45 -0700, Voyager wrote:
> 
> > How can I put data from one source to different indexes depending of a  
> > field? Let say I have some data and I want to put it in two different  
> > indexes depending of timestamp.  
> > And if it possible to make this from mappping.
> 
> You need to handle this in your application
> 
> clint

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Voyager](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/voyager/32/2431_2.png) [@Voyager](https://discuss.elastic.co/u/Voyager)
#### Post date: [March 19, 2013, 8:22am UTC](https://discuss.elastic.co/t/data-in-different-indexes-depending-of-a-field/11187/4 "2013-03-19T08:22:32Z")

</div>

Nobody knows another solution?

On Monday, March 18, 2013 1:16:20 PM UTC+2, Voyager wrote:

> I know that, but I'm asking if there is another solution, because I can't  
> do it from my source application. One solution is to have a script between  
> source application, which is not my application, and elasticsearch, but I'm  
> searching for a better and easier solution.
> 
> On Monday, March 18, 2013 1:03:18 PM UTC+2, Clinton Gormley wrote:
> 
> > On Mon, 2013-03-18 at 02:45 -0700, Voyager wrote:
> > 
> > > How can I put data from one source to different indexes depending of a  
> > > field? Let say I have some data and I want to put it in two different  
> > > indexes depending of timestamp.  
> > > And if it possible to make this from mappping.
> > 
> > You need to handle this in your application
> > 
> > clint

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [March 19, 2013, 2:56pm UTC](https://discuss.elastic.co/t/data-in-different-indexes-depending-of-a-field/11187/5 "2013-03-19T14:56:04Z")

</div>

You could technically write a plugin that will do the routing for you, but  
it would far more complicated than simply writing code on the application  
side. This type of logic belongs at the application level, not at the  
storage level.

Perhaps an alternative solution would be to reconsider the use of multiple  
indices and change the data model. Of course, it is use-case dependent.

--  
Ivan

On Tue, Mar 19, 2013 at 1:22 AM, Voyager [voyagersm@gmail.com](mailto:voyagersm@gmail.com) wrote:

> Nobody knows another solution?
> 
> On Monday, March 18, 2013 1:16:20 PM UTC+2, Voyager wrote:
> 
> > I know that, but I'm asking if there is another solution, because I can't  
> > do it from my source application. One solution is to have a script between  
> > source application, which is not my application, and elasticsearch, but I'm  
> > searching for a better and easier solution.
> > 
> > On Monday, March 18, 2013 1:03:18 PM UTC+2, Clinton Gormley wrote:
> > 
> > > On Mon, 2013-03-18 at 02:45 -0700, Voyager wrote:
> > > 
> > > > How can I put data from one source to different indexes depending of a  
> > > > field? Let say I have some data and I want to put it in two different  
> > > > indexes depending of timestamp.  
> > > > And if it possible to make this from mappping.
> > > 
> > > You need to handle this in your application
> > > 
> > > clint
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Voyager](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/voyager/32/2431_2.png) [@Voyager](https://discuss.elastic.co/u/Voyager)
#### Post date: [March 20, 2013, 8:16am UTC](https://discuss.elastic.co/t/data-in-different-indexes-depending-of-a-field/11187/6 "2013-03-20T08:16:20Z")

</div>

Thanks for the answer but I need to send logs from couchbase, with an  
plugin (  
[The Couchbase Transport for Elasticsearch Updated](http://blog.couchbase.com/couchbase-and-full-text-search-couchbase-transport-elastic-search))  
and it doesn't have some much settings, and I can't modify it. That's why I  
ask for another solution.

On Tue, Mar 19, 2013 at 4:56 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> You could technically write a plugin that will do the routing for you, but  
> it would far more complicated than simply writing code on the application  
> side. This type of logic belongs at the application level, not at the  
> storage level.
> 
> Perhaps an alternative solution would be to reconsider the use of multiple  
> indices and change the data model. Of course, it is use-case dependent.
> 
> --  
> Ivan
> 
> On Tue, Mar 19, 2013 at 1:22 AM, Voyager [voyagersm@gmail.com](mailto:voyagersm@gmail.com) wrote:
> 
> > Nobody knows another solution?
> > 
> > On Monday, March 18, 2013 1:16:20 PM UTC+2, Voyager wrote:
> > 
> > > I know that, but I'm asking if there is another solution, because I  
> > > can't do it from my source application. One solution is to have a script  
> > > between source application, which is not my application, and elasticsearch,  
> > > but I'm searching for a better and easier solution.
> > > 
> > > On Monday, March 18, 2013 1:03:18 PM UTC+2, Clinton Gormley wrote:
> > > 
> > > > On Mon, 2013-03-18 at 02:45 -0700, Voyager wrote:
> > > > 
> > > > > How can I put data from one source to different indexes depending of  
> > > > > a  
> > > > > field? Let say I have some data and I want to put it in two different  
> > > > > indexes depending of timestamp.  
> > > > > And if it possible to make this from mappping.
> > > > 
> > > > You need to handle this in your application
> > > > 
> > > > clint
> > > > 
> > > > --  
> > > > 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).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 20, 2013, 8:53am UTC](https://discuss.elastic.co/t/data-in-different-indexes-depending-of-a-field/11187/7 "2013-03-20T08:53:56Z")

</div>

Hmmmm. I now understand your concern.

From a couch base point of view, one bucket = one ES index.  
So you can put your logs in different Couchbase buckets and replicate each bucket to a given index, can't you?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 20 mars 2013 à 09:16, Mihai Sandu [voyagersm@gmail.com](mailto:voyagersm@gmail.com) a écrit :

> Thanks for the answer but I need to send logs from couchbase, with an plugin ([The Couchbase Transport for Elasticsearch Updated](http://blog.couchbase.com/couchbase-and-full-text-search-couchbase-transport-elastic-search)) and it doesn't have some much settings, and I can't modify it. That's why I ask for another solution.
> 
> On Tue, Mar 19, 2013 at 4:56 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:  
> You could technically write a plugin that will do the routing for you, but it would far more complicated than simply writing code on the application side. This type of logic belongs at the application level, not at the storage level.
> 
> Perhaps an alternative solution would be to reconsider the use of multiple indices and change the data model. Of course, it is use-case dependent.
> 
> --  
> Ivan
> 
> On Tue, Mar 19, 2013 at 1:22 AM, Voyager [voyagersm@gmail.com](mailto:voyagersm@gmail.com) wrote:  
> Nobody knows another solution?
> 
> On Monday, March 18, 2013 1:16:20 PM UTC+2, Voyager wrote:  
> I know that, but I'm asking if there is another solution, because I can't do it from my source application. One solution is to have a script between source application, which is not my application, and elasticsearch, but I'm searching for a better and easier solution.
> 
> On Monday, March 18, 2013 1:03:18 PM UTC+2, Clinton Gormley wrote:  
> On Mon, 2013-03-18 at 02:45 -0700, Voyager wrote:
> 
> > How can I put data from one source to different indexes depending of a  
> > field? Let say I have some data and I want to put it in two different  
> > indexes depending of timestamp.  
> > And if it possible to make this from mappping.
> 
> You need to handle this in your application
> 
> clint
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Voyager](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/voyager/32/2431_2.png) [@Voyager](https://discuss.elastic.co/u/Voyager)
#### Post date: [March 21, 2013, 1:27pm UTC](https://discuss.elastic.co/t/data-in-different-indexes-depending-of-a-field/11187/8 "2013-03-21T13:27:39Z")

</div>

Thanks but I will modify the couchbase plugin.

On Wed, Mar 20, 2013 at 10:53 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Hmmmm. I now understand your concern.
> 
> From a couch base point of view, one bucket = one ES index.  
> So you can put your logs in different Couchbase buckets and replicate each  
> bucket to a given index, can't you?
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 20 mars 2013 à 09:16, Mihai Sandu [voyagersm@gmail.com](mailto:voyagersm@gmail.com) a écrit :
> 
> Thanks for the answer but I need to send logs from couchbase, with an  
> plugin (  
> [The Couchbase Transport for Elasticsearch Updated](http://blog.couchbase.com/couchbase-and-full-text-search-couchbase-transport-elastic-search))  
> and it doesn't have some much settings, and I can't modify it. That's why I  
> ask for another solution.
> 
> On Tue, Mar 19, 2013 at 4:56 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > You could technically write a plugin that will do the routing for you,  
> > but it would far more complicated than simply writing code on the  
> > application side. This type of logic belongs at the application level, not  
> > at the storage level.
> > 
> > Perhaps an alternative solution would be to reconsider the use of  
> > multiple indices and change the data model. Of course, it is use-case  
> > dependent.
> > 
> > --  
> > Ivan
> > 
> > On Tue, Mar 19, 2013 at 1:22 AM, Voyager [voyagersm@gmail.com](mailto:voyagersm@gmail.com) wrote:
> > 
> > > Nobody knows another solution?
> > > 
> > > On Monday, March 18, 2013 1:16:20 PM UTC+2, Voyager wrote:
> > > 
> > > > I know that, but I'm asking if there is another solution, because I  
> > > > can't do it from my source application. One solution is to have a script  
> > > > between source application, which is not my application, and elasticsearch,  
> > > > but I'm searching for a better and easier solution.
> > > > 
> > > > On Monday, March 18, 2013 1:03:18 PM UTC+2, Clinton Gormley wrote:
> > > > 
> > > > > On Mon, 2013-03-18 at 02:45 -0700, Voyager wrote:
> > > > > 
> > > > > > How can I put data from one source to different indexes depending of  
> > > > > > a  
> > > > > > field? Let say I have some data and I want to put it in two  
> > > > > > different  
> > > > > > indexes depending of timestamp.  
> > > > > > And if it possible to make this from mappping.
> > > > > 
> > > > > You need to handle this in your application
> > > > > 
> > > > > clint
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:45am UTC](https://discuss.elastic.co/t/data-in-different-indexes-depending-of-a-field/11187/9 "2017-07-06T02:45:24Z")

</div>


