Write Points From CSV to InfluxDB

Anais Dotis
Apr 4 · 6 min read

Requirements and Setup for Importing Data From CSV to InfluxDB

telegraf -sample-config -input-filter file -output-filter influxdb > file.conf

4 Steps to CSV Data Ingest to InfluxDB

## Data format to consume. 
data_format = "csv"
## Indicates how many rows to treat as a header. By default, the parser assumes
## there is no header and will parse the first row as data. If set to anything more
## than 1, column names will be concatenated with the name listed in the next header row.
## If `csv_column_names` is specified, the column names in header will be overridden.
csv_header_row_count = 1
## Indicates the number of rows to skip before looking for header information.
csv_skip_rows = 1
## Indicates the number of columns to skip before looking for data to parse. ## These columns will be skipped in the header as well. csv_skip_columns = 1 ## The character reserved for marking a row as a comment row
## Commented rows are skipped and not parsed csv_comment = "#"
## The column to extract the name of the metric from csv_measurement_column = "measurement_name"
## Columns listed here will be added as tags. Any other columns
## will be added as fields. csv_tag_columns = ["tag_key"]
## The column to extract time information for the metric
## `csv_timestamp_format` must be specified if this is used csv_timestamp_column = "time"
## The format of time data extracted from `csv_timestamp_column`
## this must be specified if `csv_timestamp_column` is specified csv_timestamp_format = "unix_ns"
telegraf --config $pwd/file.conf

Conclusions About Importing CSV to InfluxDB

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade