CSV
Select CSV as the query type to retrieve data from CSV files or endpoints. You can query data from a URL or provide inline CSV data.
Tip
For a quick start, refer to How to Visualize CSV Data with Grafana or the Visualize CSV data using the Infinity data source learning journey.
With Grafana Play, you can explore and see how it works, learning from practical examples to accelerate your development. This feature can be seen on Infinity plugin CSV demo.
Query a CSV URL
Enter the CSV URL in the query editor. By default, CSV data should have column headers in the first row and use comma delimiters.
Example URL: https://thingspeak.com/channels/38629/feed.csv
Sample data:
created_at,entry_id,field1,field2
2021-02-18 21:46:23 UTC,10458189,6.000000,12.000000
2021-02-18 21:46:39 UTC,10458190,0.000000,36.000000
2021-02-18 21:46:55 UTC,10458191,0.000000,49.000000Define columns
By default, all columns are returned as strings. To properly format your data, define columns with their types:
For time series visualizations, you need at least one time column and one or more numeric columns.
Query data without a time field
For data without timestamps, set the Format to Timeseries to add a simulated time field. This allows visualization in panels like Bar Gauge, Stats, and Gauge.
Example data:
Country,Population
India,3000
China,3500
UK,1200
USA,2000
Germany,700Use inline CSV data
Instead of querying a URL, you can provide CSV data directly:
- Set Source to Inline.
- Enter your CSV data in the data field.
- Define columns to specify types.
Example inline data:
country,population,capital
india,200,mumbai
china,500,beijing
usa,200,washington
canada,100,ottawaCSV options
Configure parsing behavior for non-standard CSV files:
CSV without headers
If your CSV file doesn’t include a header row, specify column names in the Headers option as a comma-separated list.
TSV and custom delimiters
For tab-separated files, either:
- Set the Delimiter to
\tin CSV options, or - Select TSV as the query type
Time series field combinations
The Infinity data source automatically handles various field combinations for time series visualization:
Advanced transformations
For advanced operations like grouping, ordering, and field manipulation, use the UQL parser:
parse-csv
| order by "field" asc


