InfluxDB: Regular Expression in Output

Apologies for the vague title but I’m hoping the example below makes it clearer

Data-source:
| Name | #Messages |
| US-In-Temperature | 5 |
| US-In-Delta | 10 |
| EU-In-Temperature | 2 |
| EU-In-Delta | 0 |

I want to write a query which creates a table that with regex pulls out the US/EU part and put it in a third column next to the Name and #Messages but for the life of me I can’t figure out how to get regex to work outside of WHERE statements. It’s fine if it’s through a transform rule also.

Thanks in advanced for the help!

You are using Discouraged schema design - Avoid putting more than one piece of information in one tag. I would fix schema design first - e.g. add location tag instead of hacking and finding workarounds later - like you have problem now in Grafana.

https://docs.influxdata.com/influxdb/v1.8/concepts/schema_and_data_layout/#avoid-putting-more-than-one-piece-of-information-in-one-tag

Thanks for the info! Sadly I’m not in control of the data so it isn’t possible for me to fix anything about the source data. Could I pester you for a workaround without modifying the source?

This topic was automatically closed after 365 days. New replies are no longer allowed.