Hi!
I need to download data from Grafana through InfluxDB. I know it is possible to do it in Python using a specific package. I was wondering if it is possible to do the same in MATLAB. Reading the forum, I saw that there are a couple of functions that could be used, but I would like to understand if there is an official Matlab Toolbox or some function that I coud use instead having an API Token to access the data.
Thank you,
Andrea

 採用された回答

Taylor
Taylor 2025 年 10 月 22 日

0 投票

This is not technically an "official" (read: paid) toolbox , but it was created by a MathWorker.
https://www.mathworks.com/matlabcentral/fileexchange/180619-matlab-interface-for-influxdb

その他の回答 (1 件)

Kotya Karapetyan
Kotya Karapetyan 2026 年 4 月 17 日

0 投票

For the sake of completeness, this is how I do it:
user = '<username>';
pass = '<pwd>';
url = 'https://<domain>.com:1443';
db = <db_name>;
opts = weboptions('Username', user, 'Password', pass, ...
'ContentType', 'json', 'Timeout', 60);
t_start_ms = round(posixtime(start_datetime)) * 1000;
t_end_ms = round(posixtime(end_datetime)) * 1000;
q = sprintf('SELECT mean("<signal>.average") FROM "<table>" WHERE "<signal>.average">0 and time >= %dms AND time <= %dms GROUP BY time(1m) fill(0)', t_start_ms, t_end_ms);
resp = webread([url '/query'], 'db', db, 'epoch', 's', 'q', q, opts);
results = resp.results.series.values;

質問済み:

2025 年 10 月 13 日

回答済み:

2026 年 4 月 17 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by