Folder filtering on dashboard operations not working as expected #551
-
|
I had been trying to use the -f / --folder filtering options when trying to upload / download / list subcommands, but the filter consition is not matching as per the debug output Tried commands Logs: I am trying to download all teh dashboards from a sub nested folder,
But no luck on getting the filter applies, i am sure i might bemissing something here onfig section |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The String encoding and matching gets a bit odd since searching and encoding are a bit different. There's some special chars that get goofy. If you know the exact folder name you have in grafana the easiest pattern I've used is taking the full path end encoding it (Yeah terrible choice of words here. It's printing out regex not really encoding it but the tool is handly). You can use the output in both the gdg config and filters. Example: gdg tools helpers folder encode "Content for Reports and Presentations/S1 Demo"
2026-02-25 20:29:15 INF Encoded result output=Content\+for\+Reports\+and\+Presentations/S1\+DemoUse the value from the encoded output as your filter: gdg backup dashboards list -f "Content\+for\+Reports\+and\+Presentations/S1\+Demo"
2026-02-25 20:32:42 WRN Tokens do no operate across multiple Organizations. Cannot verify or scope into the given org. Please be sure your token belongs to the correct organization "configure organization"=Main Org.
2026-02-25 20:32:42 INF Listing dashboards for context context=staging orgName=Main Org. count=2
┌──────┬───────────────┬───────────────┬─────────┬───────────────────────────────────────────────┬────────────────┬──────┬─────────────────────────────────────────────────────────────────────────┐
│ ID │ TITLE │ SLUG │ FOLDER │ NESTEDPATH │ UID │ TAGS │ URL │
├──────┼───────────────┼───────────────┼─────────┼───────────────────────────────────────────────┼────────────────┼──────┼─────────────────────────────────────────────────────────────────────────┤
│ 2623 │ yak-utia │ yak-utia │ S1 Demo │ Content+for+Reports+and+Presentations/S1+Demo │ cemk1kkue3x1cb │ │ http://localhost:3000/d/cemk1kkue3x1cb/yak-utia │
│ 2628 │ New dashboard │ new-dashboard │ S1 Demo │ Content+for+Reports+and+Presentations/S1+Demo │ cen248mde76rka │ │ http://localhost:3000/d/cen248mde76rka/new-dashboard │
└──────┴───────────────┴───────────────┴─────────┴───────────────────────────────────────────────┴────────────────┴──────┴─────────────────────────────────────────────────────────────────────────┘In your case I think the correct syntax would be: gdg -c test.yml b dash download -f "Parent\+Folder/Nested\+Folder/Sub\+Nested\+Folder"You can throw a .* if you want it to recursively match. This can be a very handy resource to get the right expression: https://regex101.com/r/XOkpQH/1 (That's my use case) This is for your use case: https://regex101.com/r/Mu85oW/1 |
Beta Was this translation helpful? Give feedback.
Thank you I will give it a try and let you know