Reputation: 454
Basically I want to relabel the metric value , path = /api/v2/users/-/hashes/004fc134-93ba-4c48-b0da-e114f2245b77/activate
to
/api/v2/users/externalhashes/ops
I tried this below but its not working. Am i missing something?
metric_relabel_configs:
- source_labels: [path]
regex: (\/api\/v2\/users\/+.\/hashes\/[0-9a-z\-]{1,40}\/\w.*)
replacement: ‘/api/v2/users/externalhashes/ops’
target_label: path
Upvotes: 0
Views: 338
Reputation: 101
Prometheus uses Golang re2
package to parse Regular expressions
https://github.com/google/re2/wiki/Syntax
Googling quickly for a tester I found this https://regoio.herokuapp.com/
Marcelo's answer does the work :+1:
Upvotes: 1
Reputation: 22311
Try the following:
regex: '/api/v2/users/.+/hashes/[0-9a-z\-]{1,40}/\w.*'
Upvotes: 1