# Create custom \_id for events uploaded via file from data visualizer option in ML (Kibana)

**URL:** <https://discuss.elastic.co/t/create-custom-id-for-events-uploaded-via-file-from-data-visualizer-option-in-ml-kibana/254791>\
**Category:** Kibana\
**Tags:** elastic-stack-machine-learning\
**Created:** [November 9, 2020, 4:10pm UTC](https://discuss.elastic.co/t/create-custom-id-for-events-uploaded-via-file-from-data-visualizer-option-in-ml-kibana/254791 "2020-11-09T16:10:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aditya\_Srivastava1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aditya_srivastava1/32/78687_2.png) [@Aditya\_Srivastava1](https://discuss.elastic.co/u/Aditya_Srivastava1)\
**Post date:** [November 9, 2020, 4:10pm UTC](https://discuss.elastic.co/t/create-custom-id-for-events-uploaded-via-file-from-data-visualizer-option-in-ml-kibana/254791/1 "2020-11-09T16:10:02Z")

</div>

Hi Team,

I have a simple csv file with 4 columns that I want to upload and push in ES. For that I am using the data visualizer option in ML (on Kibana). I click on import file, select the file, enter index name and done.  
My issue is that I want to change and have a custom '\_id' value (say 1st column from the csv file as '\_id'), so that I can handle any duplicate data uploaded next time.  
If I use logstash, I am aware I can use document\_id in ES output, but how do I achieve the above while directly uploading the file from Kibana.

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![droberts195](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/droberts195/32/17692_2.png) [@droberts195](https://discuss.elastic.co/u/droberts195)\
**Post date:** [November 10, 2020, 9:58am UTC](https://discuss.elastic.co/t/create-custom-id-for-events-uploaded-via-file-from-data-visualizer-option-in-ml-kibana/254791/2 "2020-11-10T09:58:27Z")

</div>

On the "Advanced" tab of the file import page you can edit the ingest pipeline. Add something like this at the end of the `processors` array:

```auto
    {
      "set": {
        "field": "_id",
        "value": "{{my_first_column_name}}"
      }
    }

```

This should copy the value from your first column into `_id`. (Obviously replace `my_first_column_name` with whatever it is in your file.)

---

<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:** [December 8, 2020, 9:58am UTC](https://discuss.elastic.co/t/create-custom-id-for-events-uploaded-via-file-from-data-visualizer-option-in-ml-kibana/254791/3 "2020-12-08T09:58:33Z")

</div>

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