# Transform doesn't create a destination index

**URL:** <https://discuss.elastic.co/t/transform-doesnt-create-a-destination-index/293867>\
**Category:** Elasticsearch\
**Tags:** painless, transforms\
**Created:** [January 10, 2022, 9:14am UTC](https://discuss.elastic.co/t/transform-doesnt-create-a-destination-index/293867 "2022-01-10T09:14:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![knopkosasha](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@knopkosasha](https://discuss.elastic.co/u/knopkosasha)\
**Post date:** [January 10, 2022, 9:14am UTC](https://discuss.elastic.co/t/transform-doesnt-create-a-destination-index/293867/1 "2022-01-10T09:14:57Z")

</div>

I'm trying to compare data in two indices using a slightly altered version of transform from [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/transform-painless-examples.html#painless-compare)

```auto
curl -v -H "content-type: application/json" -X PUT http://elastic-cluster:9200/_transform/compare_idx -d '{
  "id" : "compare_idx",
  "source" : { 
    "index" : [
      "index_1",
      "index_2"
    ],
    "query" : {
      "match_all" : { }
    }
  },
  "dest" : { 
    "index" : "compare_indices"
  },
  "pivot" : {
    "group_by" : {
      "unique-id" : {
        "terms" : {
          "field" : "_id" 
        }
      }
    },
    "aggs" : {
	  "count_indices" : {
	    "cardinality": {
        "field": "_index",
        "precision_threshold": 1 
      }
	  },
	  "filter_nulls" : {
	    "bucket_selector" : {
		  "buckets_path" : {
		  "count" : "count_indices"
		  },
		  "script" : "params.count == 1"
		}
	  }
    }
  }
}
'

```

In the preview mode everything works as expected. However, when I try to create a transform, it's being created fine, but /\_cat/\_indices doesn't provide me with "compare\_indices" index. Documentation says **dest** index is supposed to be created automatically. Am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![Camilla\_Montonen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/camilla_montonen/32/58449_2.png) [@Camilla\_Montonen](https://discuss.elastic.co/u/Camilla_Montonen)\
**Post date:** [January 10, 2022, 9:35am UTC](https://discuss.elastic.co/t/transform-doesnt-create-a-destination-index/293867/2 "2022-01-10T09:35:21Z")

</div>

Hi @knopkosasha !  
Your transform config looks fine, but I am wondering - did you start the transform by using the REST API call to the `_start` endpoint like this

```auto
POST _transform/<transform_id>/_start

```

(see the docs here [Start transform API | Elasticsearch Guide [7.16] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html))

After you create the transform config, you also need to start the transform job. This will transform the data according to your config and write it into the destination index.

---

<div class="post-metadata">

**Author:** ![knopkosasha](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@knopkosasha](https://discuss.elastic.co/u/knopkosasha)\
**Post date:** [January 10, 2022, 10:08am UTC](https://discuss.elastic.co/t/transform-doesnt-create-a-destination-index/293867/3 "2022-01-10T10:08:46Z")

</div>

Oh, thanks! I'm pretty new to transforms through curl (used to work through Kibana). That helped a lot

---

<div class="post-metadata">

**Author:** ![Camilla\_Montonen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/camilla_montonen/32/58449_2.png) [@Camilla\_Montonen](https://discuss.elastic.co/u/Camilla_Montonen)\
**Post date:** [January 10, 2022, 12:18pm UTC](https://discuss.elastic.co/t/transform-doesnt-create-a-destination-index/293867/4 "2022-01-10T12:18:57Z")

</div>

No worries! Feel free to come back with questions if anything else comes up!

---

<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:** [February 7, 2022, 12:19pm UTC](https://discuss.elastic.co/t/transform-doesnt-create-a-destination-index/293867/5 "2022-02-07T12:19:53Z")

</div>

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