Rewrite values in the query #121
Replies: 3 comments 7 replies
-
The Regex is intended primarily for determining which datasource to use and filtering purposes. There's nothing in the too currently that supports rewrites. I'd like to add support for plugins though it was initially intended mainly to provide more flexibility for input and output destination. I wrote this bit of code a few years back not sure how useful it would be but it deals with manipulating the data a bit, query and such. Some of it is very custom to netsage project, other might be reusable. https://github.com/netsage-project/netsage-grafana-configs/tree/master/templates I will say that regex manipulation and such is really error prone. If you really want to control how a dashboard looks you might look at: https://grafana.com/blog/2022/12/06/a-complete-guide-to-managing-grafana-as-code-tools-tips-and-tricks/. Downside it's a 1 way route. Aka can't easily import the changes someone made on a dashboard back into code. GDG and similar tool rely on the API which is great for imports/exports but modifying the generated JSON isn't always very easy to do. |
Beta Was this translation helpful? Give feedback.
-
TLDR: I don't mind adding this feature but I will say that this might be something I'd rather support via plugins and might take a while before we're at that point. |
Beta Was this translation helpful? Give feedback.
-
@romankydybets I may revisit this but I imagine we'll need to have some embedded scripting language to support this. I've used some JS engine with Go, though I need to explore others. I'd prefer golang but not sure if it has enough adoption to really make sense. Anyways, this might be getting revisited. |
Beta Was this translation helpful? Give feedback.
-
During the process for import/export dashboard through the environments, sometime i do need rewrite some parts inside the query. Unfortunately they couldn't be covered by regular expressions,
Is there any chance to do it with your tool?
Beta Was this translation helpful? Give feedback.
All reactions