i have a metric and label like this: namedprocess_namegroup_num_procs{groupname:"/data/home/user01/app.service.1/service"}, i want to get the last field: service, and the number in last but one field. i try to write a regex, but it is not work, someone know how to write it?
relabel_configs:
- source_labels: [groupname]
target_label: service
regex: "/data/home/user01/(.+)/(.+)
replacement: ${2}
- source_labels: [groupname]
target_label: tmp
regex: [^/]+d
replacement: ${1}
- source_labels: [tmp]
target_label: num
regex: (d)
replacement: ${1}