This thread imported from Wavefront Jive, original Author: selliott Jul 25, 2016 5:44 PM
-------
I want to create a dynamic variable for part of an expression but am having trouble. This is what my expression looks like:
stats.gauges.com.edmunds.data.solr.master.inventory.matches.honda.newCount.intColor
stats.gauges.com.edmunds.data.solr.master.inventory.matches.ford.newCount.intColor
stats.gauges.com.edmunds.data.solr.master.inventory.matches.chevrolet.newCount.intColor
stats.gauges.com.edmunds.data.solr.master.inventory.matches.dodge.newCount.intColor
From this, I'd like to get a dynamic list of: [honda, ford, chevrolet, dodge] for example (I don't want a hard coded list, as this is just an example, the real data is much larger and more variant).
I tried using field=metric with this:
aliasMetric(ts("stats.gauges.com.edmunds.data.solr.master.inventory.matches.*.newCount.intColor"), metric, 10)
and this:
aliasMetric(ts("stats.gauges.com.edmunds.data.solr.master.inventory.matches.*"), metric, 10)
Among others. But I get this error:
Query syntax error: Duplicate query key when transforming:stats.gauges.com.edmunds.data.solr.master.inventory.matches.hyundai.newCount.intColor/statsd/[hyundai] into: newCount/statsd/[hyundai], another series is already transformed into the resultant key
Hi Shaun,
Based on your use case it seems like taggify is a more apt function that you should use This function allows you to extract a string from a metric name, source name, or point tag value from the result of expression, and use that extracted string to create a synthetic point tag.
taggify(ts(stats.gauges.com.edmunds.data.solr.master.inventory.matches.*.newCount.intColor),metric,model,9,".")
Use can then use this as a query expression for your dynamic dashboard variable and choose the point tag you just created to get a dynamic list of all model variants See here -> https://metrics.wavefront.com/u/KyvljQpq7S
Hope this helps which your problem at hand
Salil D
Hi Shaun,
Based on your use case it seems like taggify is a more apt function that you should use This function allows you to extract a string from a metric name, source name, or point tag value from the result of expression, and use that extracted string to create a synthetic point tag.
taggify(ts(stats.gauges.com.edmunds.data.solr.master.inventory.matches.*.newCount.intColor),metric,model,9,".")
Use can then use this as a query expression for your dynamic dashboard variable and choose the point tag you just created to get a dynamic list of all model variants See here -> https://metrics.wavefront.com/u/KyvljQpq7S
Hope this helps which your problem at hand
Salil D