Timestamp column could not be found

Juan_Alonso_Pla
Mon, 29 Jan 2024 08:56:38 +0000
Telegraf

Hello everyone!

I am having a few problems while writing a csv file to InfluxDB through Telegraf.

This is the part of the configuration file that applies to reading the csv:

  ## Data format to consume.
  data_format = "csv"
  csv_column_names = ["measurement","pressure","sensor","timestamp","id"]
  csv_column_types = ["string", "int", "string", "string", "int"]
  csv_delimiter = ";"
  csv_tag_columns = ["sensor","id"]
  csv_measurement_column = "measurement"
  csv_timestamp_column = "timestamp"
  csv_timestamp_format = "2006-01-02 15:04:05"
  csv_timezone = "Europe/Madrid"

Here is an example of the csv file:

pressure;287;S6;2024-01-29 08:17:00.000;1
pressure;153;S6;2024-01-29 08:17:04.000;1
pressure;356;S6;2024-01-29 08:17:07.000;1

But Telegraf is outputing this problem:

It is strange since it has been working properly until I added environmental variables to the Telegraf configuration file. Also, when commenting out the lines regarding the timestamp, it reads the csv properly, assigning the current timestamp to the metrics.

Note: I am using the [[inputs.exec]] plugin to create the csv, but I only added the csv configuration section since it appears to be the source of the problem.

I have been blocked at this point for a few days, so if any of you could help me out, I would highly appreciate it.

Thank you in advance.

3 posts - 2 participants