github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/hcl2/functions/uuid/uuidv4.mdx (about) 1 --- 2 layout: docs 3 page_title: v4 - uuid - Functions - Configuration Language 4 sidebar_title: uuidv4 5 description: The uuidv4 function generates a unique id. 6 --- 7 8 # `uuidv4` Function 9 10 `uuidv4` generates a unique identifier string. 11 12 The id is a generated and formatted as required by [RFC 4122 section 13 4.4](https://tools.ietf.org/html/rfc4122#section-4.4), producing a Version 4 14 UUID. The result is a UUID generated only from pseudo-random numbers. 15 16 This function produces a new value each time it is called, and so using it 17 directly in job arguments will result in spurious diffs. We do not 18 recommend using the `uuidv4` function in resource configurations. 19 20 ## Examples 21 22 ```shell-session 23 > uuidv4() 24 b5ee72a3-54dd-c4b8-551c-4bdc0204cedb 25 ``` 26 27 ## Related Functions 28 29 - [`uuidv5`](/docs/job-specification/hcl2/functions/uuid/uuidv5), which generates name-based UUIDs.