# Elastic transform

**URL:** <https://discuss.elastic.co/t/elastic-transform/311701>\
**Category:** Elasticsearch\
**Tags:** transforms\
**Created:** [August 9, 2022, 9:42am UTC](https://discuss.elastic.co/t/elastic-transform/311701 "2022-08-09T09:42:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amol](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Amol](https://discuss.elastic.co/u/Amol)\
**Post date:** [August 9, 2022, 9:42am UTC](https://discuss.elastic.co/t/elastic-transform/311701/1 "2022-08-09T09:42:08Z")

</div>

Hello Team,

I'm able to create index through Transform with the help of Dev tool.  
But to avoid or over-write documents with same unique ID, I need to pass Document ID in transform, but I'm not able to add it.

Kindly anyone could suggest, how to include document ID in transform through Dev tool in kibana.

```auto
PUT _transform/unique_user_jul22
{
  "source": {
    "index": [
      "test_index"
    ],
    "query": {
      "bool": {
        "filter": [
          {
            "range": {
              "@timestamp": {
                "gte": "2022-07-01T00:00:00.000Z",
                "lte": "2022-07-31T23:59:59.920Z"
              }
            }
          }
        ]
      }
    }
  },
  "pivot": {
    "group_by": {
      "name.keyword": {
        "terms": {
          "field": "name.keyword"
        }
      }
    },
    "aggregations": {
      "active.keyword.cardinality": {
        "cardinality": {
          "field": "active.keyword"
        }
      }
    }
  },
  "frequency": "1m",
  "dest": {
    "index": "user_jul22"
  },
  "sync": {
    "time": {
      "field": "@timestamp",
      "delay": "60s"
    }
  },
  "settings": {
    "max_page_search_size": 500
  }
}

```

With Regards,  
@Amol

---

<div class="post-metadata">

**Author:** ![Hendrik\_Muhs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendrik_muhs/32/25802_2.png) [@Hendrik\_Muhs](https://discuss.elastic.co/u/Hendrik_Muhs)\
**Post date:** [August 9, 2022, 10:15am UTC](https://discuss.elastic.co/t/elastic-transform/311701/2 "2022-08-09T10:15:34Z")

</div>

By design you can't overwrite the doc id in a transform. However it is possible using ingest:

You can overwrite the doc id if you attach an ingest pipeline and overwrite it there with a set processor or you generate a new document id with a fingerprint processor.

I wonder: You can add a `date_histogram` in the group\_by and create 1 bucket per minute per user without manipulating the doc id.

---

<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:** [September 6, 2022, 10:16am UTC](https://discuss.elastic.co/t/elastic-transform/311701/3 "2022-09-06T10:16:21Z")

</div>

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