M
M
Maxim2022-04-04 23:44:52
Regular Expressions
Maxim, 2022-04-04 23:44:52

How to write a regular expression for grafana?

Good day, colleagues!
I'm not strong in the regular season, and therefore I ask for help.
I get cluster port statuses from two Junipers from Zabbix to Grafana and I need to write a regular routine in grafana so that it replaces metric names from this type:
Interface xe-0/0/1.0.(): Operational status
Interface xe- 0/0/2.0.(): Operational status
Interface xe-0/0/3.0.(): Operational status

To this:
xe-0/0/1.0
xe-0/0/2.0
xe-0/0/3.0

V grafana, you can manually replace each metric with the one you need, but there are 96 ports, and I would like to resort to the magic of regular expressions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2022-04-04
@Far2k

For example https://regex101.com/r/M5qu5H/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question