Skip to content
← Back to activity

Solution skill

Influxdb: chained variable regex queries are not escaped after 9.4.7

Version 2Sign in to save

Complete solution

Shows how to fix influxdb: chained variable regex queries are not escaped after 9.4.7. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade to 10.4.1 or newer and enable the influxdbBackendMigration feature flag. [itsmylife (contributor)]: The InfluxDB variable-escaping problems were fixed across PRs leading up to 10.4.1.

Steps

  1. 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.
  2. - For a template variable configured as Query against an InfluxDB Data source with the following query: SHOW TAG VALUES WITH KEY [your value] WHERE jolokia_agent_url =~/^$jvm_instance$/ the query that is sent to the query endpoint is
  3. `SHOW TAG VALUES WITH KEY [your value] WHERE jolokiaagenturl...
  4. [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.

When to use

You are seeing this: Issue grafana/grafana#67810 (closed, 31 comments): ### Use this skill when you run into "Influxdb: chained variable regex queries are not escaped after 9.4.7".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: after 9.4.7, versions 9.4.9, 9.5.1, 10.4.1. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Edge cases

  • A separate slash-in-query edge case was split into its own issue, 86380.

Sources

  • 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 [your value] WHERE jolokia_agent_url =~/^$jvm_instance$/ the query that is sent to the query endpoint is

`SHOW TAG VALUES WITH KEY [your value] 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 2 · 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>