The Wayback Machine - https://web.archive.org/web/20200523210139/https://github.com/influxdata/telegraf/issues/7288
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fredmontet opened this issue Apr 5, 2020 · 2 comments
Open

Comments

@fredmontet
Copy link

@fredmontet fredmontet commented Apr 5, 2020

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

@krollquink
Copy link

@krollquink krollquink commented May 2, 2020

Hi, Im interested to help in this issue. Could you show me where to start?

@danielnelson
Copy link
Contributor

@danielnelson danielnelson commented May 5, 2020

We should probably look for a pure Go library that can do strptime formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.