Howto extract a substring from string type query

I’m using InfluxDB and Grafana 8.3.
I’ve also log data in InfluxDB, therefore fields of type string.
I’d like to extract a part of the string from the returned query data and display this in a table.
The field data is like a key=value list, and I need the chars between a prefix and a delimiter.
Best would be a regular expression, like /tag=(.*?),/.
Is there any mechanism in Grafana to do this ?

can you please follow these steps to share your raw unformatted data? That way, the community can try and mock up your problem :+1:

The data comes from log messages of the form

some_text: key1=val1, key2=val2, ...

So a regular expression like /key1=([^,]*)/ would for example extract val1.

For the extraction of variables there is a mechanism to parse and pick, see

But it is, as far as I understand, specific for setting up variables.
What I’m looking for is a mechanism which returns sub-strings which can be visualized with a table panel.

hi, did you get what you were looking for ? I beleive I have a similar problem, but I have almost out of ideas, probably grafana still not cover what I need.

Welcome

Please provide sample data as follows

_time,_value,_measurement,_field
2022-07-12 10:00:18.240,96.27,mqtt_consumer,Kettle
2022-07-12 11:00:18.240,50.54,mqtt_consumer,Kettle
2022-07-12 12:00:18.240,99.59,mqtt_consumer,Kettle
2022-07-12 13:00:18.240,92.83,mqtt_consumer,Kettle
2022-07-12 14:00:18.240,76.01,mqtt_consumer,Kettle
2022-07-12 15:00:18.240,28.23,mqtt_consumer,Kettle
2022-07-12 16:00:18.240,37.46,mqtt_consumer,Kettle

Hi yosiasz, I get to separate the data but now I need to move the obtain values to fields, this way I can make a join transformationI cant find any transformation to get the result values and place it as field

hey @migb still waiting for you to provide sample data. Help us help you by providing that data. Is there any reason you cannot? We cant remotely read your data.

not at all, is just that I found another way to get the data to no extract the strings

1 Like

not sure I understand what you are saying but it seems you have been able to resolve your issue.

right, but now I have another one (different topic)

1 Like