Forum Discussion

drewwats's avatar
8 years ago

Dynamically Created Datapoints

 I use a ton of SQL datasources and have noticed a need for dynamically created datapoints. Basically it would look  like a regex datapoint where the matched field could be regex-captured and used as the datapoint name.

Currently, I use a regex datapoint like "client=abc,type=medical,countofsomething=(\d+)" to pull the count from SQL result set like below. The addition of "clone datapoint" functionality is noted and appreciated but this would take it a step further. What I am imagining would allow more captures and back-referencing them using \1, $1, or ${1} syntax. The benefit of this would be that the creation of one datasource and one datapoint would automatically define all datapoints instead of requiring the tedious manual creation of dozens of points (or more). Hoping this makes sense!

Creating dynamic datapoints could look like ...

Datapoint Name: ${1}_${2}

REGEX: client=(\w+),type=(\w+),countofsomething=(\d+)

Value: ${3}

 

SAMPLE RESULT SET:

client=abc,type=medical,countofsomething=123

client=def,type=medical,countofsomething=456

client=ghi,type=warranty,countofsomething=789