Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace data source name in template #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tmor
Copy link
Contributor

@tmor tmor commented Aug 6, 2020

Summary

Hello,
I used the template/variable feature and the data source names were saved.

This changes works for me.

Environments

  • Grafana 7.0.6
  • jq 1.6
  • Ubuntu 18.04 LTS on WSL1

Steps to reproduce

Example dashboard: templating-grafana7.0.6.zip

...
    "templating": {
      "list": [
        {
          "current": {
            "selected": true,
            "text": "CloudWatch(old)",
            "value": "CloudWatch(old)"
          },
...

Command:

jq -Mf ./update-datasource.jq --arg old "CloudWatch(old)" --arg new "CloudWatch(new)" < templating-grafana7.0.6.json | jq .dashboard.templating

@knoguchi
Copy link
Owner

"current" appears other part of the json. It needs some qualifier to avoid unintentional replacing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants