Write Points From CSV to InfluxDB

Anais Dotis
6 min readApr 4, 2019

Telegraf is InfluxData’s plugin-driven server agent for collecting and reporting metrics. There are over 200 input plugins, which means there’s a lot of ways to get data into InfluxDB. However, I frequently see new Influx users inquiring about how to write points from CSV to InfluxDB on InfluxData Community Site. Writing points from a CSV file is an easy way to insert familiar data into InfluxDB, which can make it easier to get acquainted with the platform.

Requirements and Setup for Importing Data From CSV to InfluxDB

In a previous article, I shared three easy methods to insert data to the database (including a Python script to convert CSV data to line protocol, InfluxDB’s data ingest format). This article is a guide for how to write points from a CSV using the Telegraf File Input Plugin. The Telegraf File Input Plugin writes points faster than a Python script would, which can be extremely useful when you’re performing a bulk import. With it, I hope to dispel any confusion that new users might have. I will assume that you are a MacOS user and have installed InfluxDB and Telegraf with Homebrew since it’s the fastest way to get up and running locally (alternatively, you can download the binary from our Downloads page or spin up the sandbox).

The accompanying repo for this blog post can be found here. To write points from CSV, we will be using the File Input Plugin with the CSV Parser.

--

--