{"id":18575818,"url":"https://github.com/paveldanilin/grafana-csv-plugin","last_synced_at":"2026-03-07T07:30:55.354Z","repository":{"id":55047047,"uuid":"260868932","full_name":"paveldanilin/grafana-csv-plugin","owner":"paveldanilin","description":"CSV datasource for Grafana 6.x.x / 7.x.x","archived":false,"fork":false,"pushed_at":"2023-02-25T00:45:00.000Z","size":162403,"stargazers_count":36,"open_issues_count":13,"forks_count":12,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2026-03-01T19:48:41.402Z","etag":null,"topics":["csv","csv-datasource","datasource","golang","grafana","plugin","sftp","sql","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paveldanilin.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-03T09:29:58.000Z","updated_at":"2024-06-23T09:25:23.000Z","dependencies_parsed_at":"2024-06-18T23:42:14.576Z","dependency_job_id":null,"html_url":"https://github.com/paveldanilin/grafana-csv-plugin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/paveldanilin/grafana-csv-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paveldanilin%2Fgrafana-csv-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paveldanilin%2Fgrafana-csv-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paveldanilin%2Fgrafana-csv-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paveldanilin%2Fgrafana-csv-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paveldanilin","download_url":"https://codeload.github.com/paveldanilin/grafana-csv-plugin/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paveldanilin%2Fgrafana-csv-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","csv-datasource","datasource","golang","grafana","plugin","sftp","sql","sqlite"],"created_at":"2024-11-06T23:22:19.689Z","updated_at":"2026-03-07T07:30:55.334Z","avatar_url":"https://github.com/paveldanilin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## CSV datasource for Grafana 6.x.x\r\n\r\nMany thanks to JetBrains for providing the OS license for an amazing GoLand IDE.\r\n\r\n[![JetBrains logo](./jetbrains-variant-2.svg)](https://www.jetbrains.com/?from=grafana-csv-plugin)\r\n\r\n#### Install\r\n- Copy files from the `dist` folder to your [Grafana plugin directory](https://grafana.com/docs/grafana/latest/plugins/installation/#grafana-plugin-directory)\r\n- Ensure that executable file has the execute flag\r\n- Restart Grafana\r\n- Check datasource list as http://you-grafana/datasources/new\r\n\r\n##### Grafana 7.x.x\r\n\u003e The plugin is unsigned, hence you may face the error:\r\n\u003e\r\n\u003e `lvl=eror msg=“Failed to load plugin” logger=plugins error=“plugin “grafana-csv-plugin” is unsigned”`\r\n\u003e\r\n\u003e To get it to work you should make configuration as described in [documentation](https://grafana.com/docs/grafana/latest/installation/configuration/#allow-loading-unsigned-plugins)\r\n\r\n#### Features\r\n- Read local CSV file\r\n- SQL queries (under the hood CSV will be converted into in-memory SQLite3 DB)\r\n- Auto-detect column types by the first data row\r\n- Reloading CSV file on changing\r\n- Query [variables](https://grafana.com/docs/grafana/latest/variables/templates-and-variables/)\r\n- Macros:\r\n  * $__timeFilter(dateColumn)\r\n  * $__timeGroup(dateColumn, interval)\r\n  * $__unixEpochFrom()\r\n  * $__unixEpochTo()\r\n\r\n#### CSV format\r\n- Each CSV file must have the first row with column names\r\n\r\n#### Query\r\n- [SQLite3](https://www.sqlite.org/index.html)\r\n- Each DS has its own table, the name of the table coincides with the DS name (for example the DS name is `my_data`, hence in a query you should select from `my_data` table)\r\n\r\n#### Macros\r\n\r\n| Macros                             | Description                               |\r\n|------------------------------------|-------------------------------------------|\r\n| $__timeFilter(dateColumn)          | Will be replaced by a time range filter using the specified column name. For example, dateColumn BETWEEN ‘2017-04-21T05:01:17Z’ AND ‘2017-04-21T05:06:17Z’ |\r\n| $__timeGroup(dateColumn, interval), Examples: `sec: $__timeGroup(dateColumn, 60); min: $__timeGroup(dateColumn, 60m); hour: $__timeGroup(dateColumn, 1h)` | Will be replaced by an expression usable in a GROUP BY clause. For example, datetime((strftime('%s', dateColumn) / 60) * 60, 'unixepoch') |\r\n| $__unixEpochFrom()                 | Will be replaced by the start of the currently active time selection as Unix timestamp. For example, 1494410783 |\r\n| $__unixEpochTo()                   | Will be replaced by the end of the currently active time selection as Unix timestamp. For example, 1494497183 |\r\n\r\n#### Build graphs\r\n\r\nExample:\r\n\r\n- CSV File: data/SacramentocrimeJanuary2006.csv\r\n- DS name `jan_2006`\r\n- group by 1 hour\r\n- filter by current time range\r\n\r\n```sql\r\nSELECT $__timeGroup(cdatetime, 1h) as \"time\", district as \"metric\", count(*) as \"value\"\r\nFROM\r\n    jan_2006\r\nWHERE\r\n    $__timeFilter(cdatetime)\r\nGROUP BY \"time\", \"metric\"\r\nORDER BY \"time\"\r\n```\r\n\r\n![](doc/image/graph1.png)\r\n\r\n\r\nExample:\r\n\r\n- CSV File: data/SalesJan2009.csv\r\n- DS name `sales`\r\n- group by 24 hours\r\n\r\n```sql\r\nSELECT $__timeGroup(Transaction_date, 24h) as \"time\", Payment_Type as \"metric\", count(*) as \"value\"\r\nFROM\r\nsales\r\nGROUP BY \"time\", \"metric\"\r\nORDER BY \"time\"\r\n```\r\n\r\n![](./doc/image/graph2.png)\r\n\r\n#### Simple table\r\n\r\n![](./doc/image/grid.png)\r\n\r\n#### Config\r\n- Read local file\r\n\r\n![](./doc/image/config_local.png)\r\n\r\n- Read remote file\r\n\r\n![](./doc/image/config_sftp.png)\r\n\r\n#### Build\r\n- npm run build\r\n\r\n#### Docker (Grafana 6.7.4)\r\n\r\nhttp://your-server:3000 `(admin/admin)`\r\n\r\n- `manage.sh build` (build docker image)\r\n- `manage.sh up` (run container)\r\n- `manage.sh down` (stop container)\r\n\r\nAfter starting container go to the showcase dashboard:\r\nhttp://your-host:3000/d/DTRcLsVGk/showcase-sales?orgId=1\r\n\r\n#### Prev version\r\n- [1.1.0](https://github.com/paveldanilin/grafana-csv-plugin/tree/1.1.0) which doesn't support SQL, but supports the filtering expressions.\r\n\r\n\r\n###### Example data set: /data\r\n###### Icon: https://freeicons.io/vector-file-types-icons/csv-icon-2272\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaveldanilin%2Fgrafana-csv-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaveldanilin%2Fgrafana-csv-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaveldanilin%2Fgrafana-csv-plugin/lists"}