# Generate UUID of the String(field) in logstash

**URL:** <https://discuss.elastic.co/t/generate-uuid-of-the-string-field-in-logstash/222943>\
**Category:** Logstash\
**Created:** [March 10, 2020, 1:36pm UTC](https://discuss.elastic.co/t/generate-uuid-of-the-string-field-in-logstash/222943 "2020-03-10T13:36:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pink11](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Pink11](https://discuss.elastic.co/u/Pink11)\
**Post date:** [March 10, 2020, 1:36pm UTC](https://discuss.elastic.co/t/generate-uuid-of-the-string-field-in-logstash/222943/1 "2020-03-10T13:36:09Z")

</div>

want to generate consistent UUID(Just like MD5) of the String(field) in logstash.  
Tried Using fingerprint with UUID but it gives random UUID.

---

<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:** [March 10, 2020, 2:25pm UTC](https://discuss.elastic.co/t/generate-uuid-of-the-string-field-in-logstash/222943/2 "2020-03-10T14:25:02Z")

</div>

That's right, the documentation says that ' When the target option is set to UUID the result won’t be a consistent hash but a random UUID." Obviously when it says 'target' it means 'method'. If you want to use MD5 then set the method option to MD5, although why anyone in the last 20 years would ever use MD5 is a mystery to me.

---

<div class="post-metadata">

**Author:** ![Pink11](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Pink11](https://discuss.elastic.co/u/Pink11)\
**Post date:** [March 10, 2020, 5:01pm UTC](https://discuss.elastic.co/t/generate-uuid-of-the-string-field-in-logstash/222943/3 "2020-03-10T17:01:57Z")

</div>

looking for something like

UUID.nameUUIDFromBytes("d41d8cd9-8f00-3204-a980-0998ecf8427e|172.31.43.240|0.0.0.0|58528|TCP".getBytes())

in java

---

<div class="post-metadata">

**Author:** ![Pink11](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Pink11](https://discuss.elastic.co/u/Pink11)\
**Post date:** [March 10, 2020, 8:37pm UTC](https://discuss.elastic.co/t/generate-uuid-of-the-string-field-in-logstash/222943/4 "2020-03-10T20:37:10Z")

</div>

looking for something like

UUID.nameUUIDFromBytes("d41d8cd9-8f00-3204-a980-0998ecf8427e|172.31.43.240|0.0.0.0|58528|TCP".getBytes())

in java

---

<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:** [March 10, 2020, 9:43pm UTC](https://discuss.elastic.co/t/generate-uuid-of-the-string-field-in-logstash/222943/5 "2020-03-10T21:43:42Z")

</div>

I think you would have to write it in a ruby filter.

---

<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:** [April 7, 2020, 9:43pm UTC](https://discuss.elastic.co/t/generate-uuid-of-the-string-field-in-logstash/222943/6 "2020-04-07T21:43:45Z")

</div>

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