# Create a document id using more than 2 fields

**URL:** <https://discuss.elastic.co/t/create-a-document-id-using-more-than-2-fields/187867>\
**Category:** Logstash\
**Created:** [June 27, 2019, 2:17pm UTC](https://discuss.elastic.co/t/create-a-document-id-using-more-than-2-fields/187867 "2019-06-27T14:17:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![edster](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@edster](https://discuss.elastic.co/u/edster)\
**Post date:** [June 27, 2019, 2:17pm UTC](https://discuss.elastic.co/t/create-a-document-id-using-more-than-2-fields/187867/1 "2019-06-27T14:17:53Z")

</div>

How can one create a document id using multiple fields, more than just two? I'm trying to use more than 3 fields but it doesn't seem to accept it unless there is another way to do it.  
Right now i'm using this format:  
document\_id =\> "%{field1}%{field2}%{field3}%{field4}%{field5}%{field6}"

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 27, 2019, 2:49pm UTC](https://discuss.elastic.co/t/create-a-document-id-using-more-than-2-fields/187867/2 "2019-06-27T14:49:33Z")

</div>

I would expect that to work. What makes you think it is not working?

---

<div class="post-metadata">

**Author:** ![edster](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@edster](https://discuss.elastic.co/u/edster)\
**Post date:** [June 27, 2019, 3:06pm UTC](https://discuss.elastic.co/t/create-a-document-id-using-more-than-2-fields/187867/3 "2019-06-27T15:06:22Z")

</div>

Because the id being returned is for example  
"ActualField1%{field2}%{field3}ActualField4%{field5}%{field6}"

However, I'm messing around with it and the issue maybe cause the fields given were in uppercase and it seems like it always needs to be lowercase but still testing this.

---

<div class="post-metadata">

**Author:** ![edster](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@edster](https://discuss.elastic.co/u/edster)\
**Post date:** [June 27, 2019, 3:09pm UTC](https://discuss.elastic.co/t/create-a-document-id-using-more-than-2-fields/187867/4 "2019-06-27T15:09:49Z")

</div>

Ok yeah that worked. All fields must be lowercase and not uppercase at all. Thank you @Badger

---

<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 25, 2019, 3:09pm UTC](https://discuss.elastic.co/t/create-a-document-id-using-more-than-2-fields/187867/5 "2019-07-25T15:09:58Z")

</div>

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