I am currently exporting data from Grafana. I do that using a script which looks like this one:
JsonSlurper slurper = new JsonSlurper() println "Collect