Skip to content

timestamp format parsing is confusing yyyyMMddHHmm for a unix timestamp #7288

@fredmontet

Description

@fredmontet

Relevant telegraf.conf:

[[inputs.http]]
   urls = [
     "https://data.geo.admin.ch/ch.meteoschweiz.messwerte-aktuell/VQHA80.csv"
   ]
   interval = "10m"
   method = "GET"
   timeout = "15s"
   data_format = "csv"
   csv_delimiter = ";"
   csv_skip_rows = 2
   csv_header_row_count = 1 
   csv_tag_columns = ["stn"]
   csv_timestamp_column = "time"
   csv_timestamp_format = "200601021504"

System info:

Telegraf 1.11.2 (git: HEAD a80d173)

Steps to reproduce:

  1. Add the input config above to your Telegraf deamon
  2. Execute the command telegraf --test --config=/etc/telegraf/<your_conf>.conf

Expected behavior:

The time timestamp is interpreted as yyyyMMddHHmm.
e.g. 200601021504 for Mon Jan 2 15:04:05 -0700 MST 2006 as in the Go documentation (https://golang.org/pkg/time/#Parse)

Actual behavior:

The time is interpreted as a UNIX format and is therefore, invalid as seen in the related log line below.

2020-04-05T06:55:51Z E! [inputs.http]: Error in plugin: [url=https://data.geo.admin.ch/ch.meteoschweiz.messwerte-aktuell/VQHA80.csv]: Invalid unix format

Metadata

Metadata

Labels

good first issueThis is a smaller issue suited for getting started in Telegraf, Golang, and contributing to OSS.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions