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 in json_v2 broken in 1.21.3 #10606

Closed
sbrass opened this issue Feb 8, 2022 · 2 comments · Fixed by #10618
Closed

timestamp_format in json_v2 broken in 1.21.3 #10606

sbrass opened this issue Feb 8, 2022 · 2 comments · Fixed by #10618
Labels
area/json json and json_v2 parser/serialiser related

Comments

@sbrass
Copy link

sbrass commented Feb 8, 2022

After updating to the most recent version of Telegraf, applying timestamp_format leads to no output.
I tried by commenting out the timestamp_format and testing against the previous version.

Config:

[[inputs.file]]
  interval = "6h"
  precision = "1s"
  name_override = "savageNumbers"
  files = ["debug.json"]

  data_format = "json_v2"
  [[inputs.file.json_v2]]
    [[inputs.file.json_v2.object]]
      path = "@this"
      timestamp_key = "timestamp"
      timestamp_format = "2006-01-02T15:04:05.9999999Z"
      timestamp_zone = "UTC"
      [inputs.file.json_v2.object.fields]
        price = "float"
        price_tag = "string"
        volume = "int"
  [inputs.file.tags]
    product = "hackback"
    exchange = "atlantis"

Input data:

[{"timestamp": "2022-01-31T09:04:31.1680000Z", "price": 822.42, "price_tag": "bB", "volume": 3}, {"timestamp": "2022-02-01T09:17:23.7590000Z", "price": 753.5, "price_tag": "bB", "volume": 15}, {"timestamp": "2022-02-02T09:04:09.1340000Z", "price": 753.27, "price_tag": "bB", "volume": 2}, {"timestamp": "2022-02-03T09:06:57.5730000Z", "price": 749.21, "price_tag": "", "volume": 10}, {"timestamp": "2022-02-04T10:20:07.4480000Z", "price": 784.9, "price_tag": "bB", "volume": 2}, {"timestamp": "2022-02-07T09:48:46.5190000Z", "price": 808.91, "price_tag": "bB", "volume": 7}, {"timestamp": "2022-02-08T09:08:35.6910000Z", "price": 813.23, "price_tag": "bB", "volume": 4}]

Expected output (with 1.21.2):

> savageNumbers,exchange=atlantis,host=rechenknecht,product=hackback price=822.42,price_tag="bB",volume=3i 1643619871000000000
> savageNumbers,exchange=atlantis,host=rechenknecht,product=hackback price=753.5,price_tag="bB",volume=15i 1643707044000000000
> savageNumbers,exchange=atlantis,host=rechenknecht,product=hackback price=753.27,price_tag="bB",volume=2i 1643792649000000000
> savageNumbers,exchange=atlantis,host=rechenknecht,product=hackback price=749.21,price_tag="",volume=10i 1643879218000000000
> savageNumbers,exchange=atlantis,host=rechenknecht,product=hackback price=784.9,price_tag="bB",volume=2i 1643970007000000000
> savageNumbers,exchange=atlantis,host=rechenknecht,product=hackback price=808.91,price_tag="bB",volume=7i 1644227327000000000
> savageNumbers,exchange=atlantis,host=rechenknecht,product=hackback price=813.23,price_tag="bB",volume=4i 1644311316000000000

Output with newest version (1.21.3):

None

May be associated with latest change in #10413?
Can anyone reproduce this behavior?

@telegraf-tiger telegraf-tiger bot added the area/json json and json_v2 parser/serialiser related label Feb 8, 2022
@powersj
Copy link
Contributor

powersj commented Feb 8, 2022

@sspaink does look like something changed here

@sspaink
Copy link
Contributor

sspaink commented Feb 10, 2022

Sorry for this regression! I was able to reproduce it as well, and luckily someone has already opened a PR to fix it: #10618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/json json and json_v2 parser/serialiser related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants