# Defining different metadata "\_id" field value

**URL:** https://discuss.elastic.co/t/defining-different-metadata-id-field-value/138356
**Category:** Elasticsearch
**Created:** [July 3, 2018, 10:44am UTC](https://discuss.elastic.co/t/defining-different-metadata-id-field-value/138356 "2018-07-03T10:44:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pastechecker](https://avatars.discourse-cdn.com/v4/letter/p/0ea827/32.png) [@pastechecker](https://discuss.elastic.co/u/pastechecker)
#### Post date: [July 3, 2018, 10:44am UTC](https://discuss.elastic.co/t/defining-different-metadata-id-field-value/138356/1 "2018-07-03T10:44:10Z")

</div>

Hello colleagues!

I am loading documents structured as follows:

> {"vulnid": "CVE-2018-0001", "product": ["juniper junos 12.1x46 d10", "juniper junos 15.1x53 d63"], "description": "A remote, unauthenticated attacker may be able to execute code by exploiting a use-after-free defect found in older versions of PHP", "cvss:confidentiality-impact": "PARTIAL", "published": "2018-01-10T17:29:00.930-05:00"}

I am using **ESBULK** tool for faster loading times, but I cannot control the metadata “\_id” field with it.

> {  
> "\_index": "softwarebugs",  
> "\_type": "default",  
> **"\_id": "aRKoX2QBV7uFZj55bVLi",**  
> "\_version": 1,  
> "\_score": null,  
> "\_source": {  
> **"vulnid": "CVE-2018-0001",**  
> "product": [  
> "juniper junos 12.1x46 d10",  
> ...(truncated data)

The \_id is automatically created for me. ("\_id": "aRKoX2QBV7uFZj55bVLi",)  
Is there a way to manipulate the data already imported to accomplish something like:

> {  
> "\_index": "softwarebugs",  
> "\_type": "default",  
> **"\_id": "CVE-2018-0001",**  
> "\_version": 1,  
> "\_score": null,  
> "\_source": {  
> **"vulnid": "CVE-2018-0001",**  
> "product": [  
> "juniper junos 12.1x46 d10",  
> ...(truncated data)

Most optimally would be to create mapping before using esbulk tool (and specify override to the "\_id" to use "vulnid" field value as "\_id".

Thank you for hints.

---

<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 31, 2018, 10:47am UTC](https://discuss.elastic.co/t/defining-different-metadata-id-field-value/138356/2 "2018-07-31T10:47:37Z")

</div>

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