Skip to content

Instantly share code, notes, and snippets.

@caquino
Created April 12, 2018 21:08
Show Gist options
  • Select an option

  • Save caquino/cebdee88499e123c6529a20690131b89 to your computer and use it in GitHub Desktop.

Select an option

Save caquino/cebdee88499e123c6529a20690131b89 to your computer and use it in GitHub Desktop.
map $request_id $formatted_id {
"~*(?<p1>[0-9a-f]{8})(?<p2>[0-9a-f]{4})(?<p3>[0-9a-f]{4})(?<p4>[0-9a-f]{4})(?<p5>.*)$" "${p1}-${p2}-${p3}-${p4}-${p5}";
}
map $http_x_request_id $uuid {
default "${formatted_id}";
~* "${http_x_request_id}";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment