paveldanilin / grafana-csv-plugin

CSV datasource for Grafana 6.x.x / 7.x.x
MIT License
36 stars 12 forks source link

not able to query with time field #30

Closed dpajin closed 3 years ago

dpajin commented 3 years ago

Hi Pavel,

I am using grafana 6.4.7 for testing. I have simple csv

cdatetime;id;name;address;postal;city;org_id;location_id;PIB;gov_id;lan_ip;cpe_ip;latitude;longitude;org_type;conn_type
01/01/20 00:00;1;aaa;addr1;24430;a1;199;802;101092309;8018731;10.85.208.0/21;172.31.8.1;45797482;20134519;test1;testconn
02/01/20 00:00;2;bbb;tret 47;24430;b1;1332;807;100983199;8018499;10.98.252.0/22;172.31.8.2;45790701;20129339;test12;testconn
03/01/20 00:00;3;cccc;sdasdas;24430;c1;1332;807;100983199;8018499;10.98.252.0/22;172.31.8.2;45790701;20129339;test13;testconn

When I make a dashboard with query: SELECT * FROM csv_test LIMIT 10 the data is shown fine and cdatetime field seems to be parsed as unix epoch time:

cdatetime id name address postal city org_id location_id PIB gov_id lan_ip cpe_ip latitude longitude org_type conn_type
1583020800000 3 cccc sdasdas 24430 c1 1332 807 100983199 8018499 10.98.252.0/22 172.31.8.2 45790701 20129339 test13 testconn
1580515200000 2 bbb tret 47 24430 b1 1332 807 100983199 8018499 10.98.252.0/22 172.31.8.2 45790701 20129339 test12 testconn
1577836800000 1 aaa addr1 24430 a1 199 802 101092309 8018731 10.85.208.0/21 172.31.8.1 45797482 20134519 test1 testconn

however if I want do any query using frield cdatetime date fails with message:

Query failed: no such column: cdatetime

For example, queries like: SELECT * FROM csv_test WHERE $__timeFilter(cdatetime) LIMIT 10 or SELECT * FROM csv_test WHERE cdatetime > 0 LIMIT 10

Queries on any other field work ok. Any ideas?

Many thanks!

dpajin commented 3 years ago

Closing the issue since it seems to be fixed with #29.