Commit 6bc898b2 by Torkel Ödegaard

fix(influxdb): fixed issue with using multi value template vars in influxdb…

fix(influxdb): fixed issue with using multi value template vars in influxdb measurement clause, fixes #4797
parent 4d802df0
...@@ -162,13 +162,13 @@ export default class InfluxQuery { ...@@ -162,13 +162,13 @@ export default class InfluxQuery {
return str + '"' + tag.key + '" ' + operator + ' ' + value; return str + '"' + tag.key + '" ' + operator + ' ' + value;
} }
getMeasurementAndPolicy() { getMeasurementAndPolicy(interpolate) {
var policy = this.target.policy; var policy = this.target.policy;
var measurement = this.target.measurement; var measurement = this.target.measurement;
if (!measurement.match('^/.*/')) { if (!measurement.match('^/.*/')) {
measurement = '"' + measurement+ '"'; measurement = '"' + measurement+ '"';
} else { } else if (interpolate) {
measurement = this.templateSrv.replace(measurement, this.scopedVars, 'regex'); measurement = this.templateSrv.replace(measurement, this.scopedVars, 'regex');
} }
...@@ -212,7 +212,7 @@ export default class InfluxQuery { ...@@ -212,7 +212,7 @@ export default class InfluxQuery {
query += selectText; query += selectText;
} }
query += ' FROM ' + this.getMeasurementAndPolicy() + ' WHERE '; query += ' FROM ' + this.getMeasurementAndPolicy(interpolate) + ' WHERE ';
var conditions = _.map(target.tags, (tag, index) => { var conditions = _.map(target.tags, (tag, index) => {
return this.renderTagCondition(tag, index, interpolate); return this.renderTagCondition(tag, index, interpolate);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment