Instead of showing the value, I need the text of the result of the variable
What happened?
The result of the variable are all the text and values.
Both of them shown in the result…
I use snmp exporter to get the ifAlias as text instead of ifName values
What did you expect to happen?
Just the text of ifAlias shown and use in the panel variable.
Can you copy/paste the configuration(s) that you are having problems with?
Below my variable:
Query: query_result(sort(ifIndex{instance="$instance"} ) )
Regex: /ifIndex{ifAlias="(?<text>.*)",ifDescr|ifName="(?<value>.*)",instance/g
That regex is following the URL above in Grafana Documentation.
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
Not at all
Did you follow any online instructions? If so, what is the URL?
Is it a bug or expected behavior if the datasource is Prometheus?
I have the same inquiry. Is there a way to reference the key OR the value depending on how you want to use it?
Example:
I have an API I am querying to retrieve a list of applications along with the application ID. I have a variable that is currently extracting the Application Name as the “text” and the ID as the “value” (Regex: “name”:"(?.)",“description”.“id”:(?[0-9]+),"account). I would like to display the Application Name (text) on the graph panel, but I want to link to the source system using the ID (value), because that is the only way to go to the application’s page in the source system.
So, using a variable and updating it in the dropdown, I would want to see “Application1” on the panel, but make a data link to go to the source app using the id “99999”
Thank you. I am using the JSON API Data source and I am able to extract the data. I need to know if there is a way to reference the “text” OR the “value” depending on what part I need.
So we know that two records pairing is:
text:“Application1” value:99999
text:“Application2” value: 12345
when the drop down on the dashboard changes to Application1, I want to be able to reference the “text” as the name of the panel in the dashboard, but I also want to use the value of 99999 to create a dynamic link to another dashboard using that 99999. Unfortunately the dashboard I am trying to reference does not allow use of the “Application1” as part of the URL, just the ID (i.e. - 99999)