Skip to content
← Back to activity

Immutable solution version

Influxdb: chained variable regex queries are not escaped after 9.4.7

Version 1Sign in to save

Complete solution

How to influxdb: chained variable regex queries are not escaped after 9.4.7. Verified in gh:grafana/grafana#67810.

What this teaches

How to influxdb: chained variable regex queries are not escaped after 9.4.7.

The problem

Issue grafana/grafana#67810 (closed, 31 comments): ###

What went wrong?

When using chained variables the value passed to the second variable is not properly escaped in the query sent to influxdb in versions 9.4.9 and 9.5.1. Up to 9.4.7 it was working correctly.

What happened:

  • For a template variable configured as Query against an InfluxDB Data source with the following query: SHOW TAG VALUES WITH KEY = "jolokia_agent_url" WHERE jolokia_agent_url =~/^$jvm_instance$/ the query that is sent to the query endpoint is

`SHOW TAG VALUES WITH KEY = "jolokiaagenturl" WHERE jolokiaagenturl...

What worked (verified answer)

[itsmylife (contributor)]: The InfluxDB variable-escaping problems were fixed across PRs leading up to 10.4.1. The reporter confirmed everything working on 10.4.1 with influxdbBackendMigration=true. Upgrade to 10.4.1 or newer and enable the influxdbBackendMigration feature flag. A separate slash-in-query edge case was split into its own issue, 86380.

Source

gh:grafana/grafana#67810 - https://github.com/grafana/grafana/issues/67810

Evidence

In gh:grafana/grafana#67810, the reporter ran into: Issue grafana/grafana#67810 (closed, 31 comments): ###

What went wrong?

When using chained variables the value passed to the second variable is not properly escaped in the query sent to influxdb in versions 9.4.9 and 9.5.1. Up to 9.4.7 it was working correctly.

What happened:

  • For a template variable configured as Query against an InfluxDB Data source with the following query: SHOW TAG VALUES WITH KEY = "jolokia_agent_url" WHERE jolokia_agent_url =~/^$jvm_instance$/ the query that is sent to the query endpoint is

`SHOW TAG VALUES WITH KEY = "jolokiaagenturl"... The verified answer was: [itsmylife (contributor)]: The InfluxDB variable-escaping problems were fixed across PRs leading up to 10.4.1. The reporter confirmed everything working on 10.4.1 with influxdbBackendMigration=true. Upgrade to 10.4.1 or newer and enable the influxdbBackendMigration feature flag. A separate slash-in-query edge case was split into its own issue, 86380. Source issue: https://github.com/grafana/grafana/issues/67810

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Bi34ZNE-305GDMIXw3WBqQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Influxdb: chained variable regex queries are not escaped after 9.4.7 <span>— Vectle</span></a>