api_csv_export_for_grafana

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
api_csv_export_for_grafana [01.09.2020 15:46] – external edit 127.0.0.1api_csv_export_for_grafana [01.09.2020 16:02] (current) Pascal Suter
Line 1: Line 1:
 ====== API CSV data Export for Grafana ====== ====== API CSV data Export for Grafana ======
-currently (Grafana version 7) it seems to not be possible to create a useful CSV table directly out of a Grafana Panel via the API. It is possible on the gui via the "Inspect" functions, but it still seems to be unavailable through the API. +currently (Grafana version 7) it seems to not be possible to create a useful CSV table directly out of a Grafana Panel via the API. It is possible on the GUI via the "Inspect" functions, but it still seems to be unavailable through the API. 
  
 looking at the requests sent to the grafana server during the Inspect action, i found a query like this one:  looking at the requests sent to the grafana server during the Inspect action, i found a query like this one: 
Line 54: Line 54:
 2020-09-01T07:45:14+02:00,707.3,741,0 2020-09-01T07:45:14+02:00,707.3,741,0
 </code> </code>
 +
 +to specify multiple targets the ''target''parameter has to be formatted as an array: 
 +
 +<code>
 +curl -s "http://myserver/csv.php?target[]=powermeter.phase1.watt&target[]=powermeter.phase2.watt&target[]=powermeter.phase3.watt&from=1598939104&until=1598939114"
 +</code>
 +would produce the same output as the above query
  
 this makes it much easier for me to process the data afterwards in libre office calc or excel or similar tools.  this makes it much easier for me to process the data afterwards in libre office calc or excel or similar tools. 
  • api_csv_export_for_grafana.1598968018.txt.gz
  • Last modified: 01.09.2020 15:46
  • by 127.0.0.1