Reputation: 21
I've been trying to save the hostname of a FQDN (ie the "xxx" part only from "xxx-xxx-xxx-xxx.sub.domain.com") to another label in prometheus for a couple of hours and I just can't figure it out. None of the the regex I'm using are doing anything:
^([-A-z0-9]+)
^([^.]+)
^[^.]*
Tested the following on https://relabeler.promlabs.com/ with object label address: "xxx-xxx-xxx-xxx.sub.domain.com"
- source_labels: [__address__]
regex: "from above"
target_label: instanceID
None of the aforementioned regex change anything.
How can I get "instanceID: xxx-xxx-xxx-xxx" from "address: xxx-xxx-xxx-xxx.sub.domain.com" in prometheus 2.40 relabel_configs?
Upvotes: 1
Views: 839