# Pushing Distinct values from an index to another index

**URL:** <https://discuss.elastic.co/t/pushing-distinct-values-from-an-index-to-another-index/271318>\
**Category:** Elasticsearch\
**Created:** [April 27, 2021, 6:31am UTC](https://discuss.elastic.co/t/pushing-distinct-values-from-an-index-to-another-index/271318 "2021-04-27T06:31:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CSehra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/csehra/32/101474_2.png) [@CSehra](https://discuss.elastic.co/u/CSehra)\
**Post date:** [April 27, 2021, 6:31am UTC](https://discuss.elastic.co/t/pushing-distinct-values-from-an-index-to-another-index/271318/1 "2021-04-27T06:31:09Z")

</div>

Is there a way to push distinct values of a field from `indexA` to a new `indexB` on a regular basis(daily or monthly)?

Use Case: I want to create `indexB` from one of the fields of `indexA`, and on a daily basis do an update on this index to be used for filtering.

---

<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:** [April 27, 2021, 7:15am UTC](https://discuss.elastic.co/t/pushing-distinct-values-from-an-index-to-another-index/271318/2 "2021-04-27T07:15:07Z")

</div>

Welcome!

That sounds like a good candidate for the reindex API.

---

<div class="post-metadata">

**Author:** ![CSehra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/csehra/32/101474_2.png) [@CSehra](https://discuss.elastic.co/u/CSehra)\
**Post date:** [April 27, 2021, 9:19am UTC](https://discuss.elastic.co/t/pushing-distinct-values-from-an-index-to-another-index/271318/3 "2021-04-27T09:19:17Z")

</div>

Thanks @dadoonet for your reply.  
I am checking out reindex API now.  
Can we do that on a regular basis directly from Kibana using a Watcher or any other service?  
like running this query each day?

---

<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:** [April 27, 2021, 1:51pm UTC](https://discuss.elastic.co/t/pushing-distinct-values-from-an-index-to-another-index/271318/4 "2021-04-27T13:51:25Z")

</div>

IMHO that would probably be easier to run that from a cronjob.

But you can probably use a watch with a webhook: [Watcher webhook action | Elasticsearch Guide [7.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-webhook.html)

---

<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:** [May 25, 2021, 1:52pm UTC](https://discuss.elastic.co/t/pushing-distinct-values-from-an-index-to-another-index/271318/5 "2021-05-25T13:52:17Z")

</div>

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