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

Unix ms not parsed correctly #10786

Closed
tgirotto opened this issue Mar 7, 2022 · 3 comments
Closed

Unix ms not parsed correctly #10786

tgirotto opened this issue Mar 7, 2022 · 3 comments
Labels
area/influxdb bug unexpected problem or unintended behavior waiting for response waiting for response from contributor

Comments

@tgirotto
Copy link

tgirotto commented Mar 7, 2022

Relevant telegraf.conf

data_format = "json_v2"

  [[inputs.http_listener_v2.json_v2]]
    measurement_name = "customers"

    [[inputs.http_listener_v2.json_v2.object]]
      path = "data"
      timestamp_key = "utc"
      timestamp_format = "unix_ms"

      included_keys = [
        "id",
        "full_name",
      ]

Logs from Telegraf

2022-03-07T15:14:22Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics

System info

Telegraf 1.21.4, Linux 4.15.0-169-generic #177-Ubuntu SMP

Docker

No response

Steps to reproduce

{
    "data" : [
        {
            "id": 449083,
            "full_name": "first customer",
            "grid_id" : 1,
            "utc": 1646666923000,
            "grid_name" : "first customer",
            "grid_type_id" : 1,
            "grid_type_name" : "some grid type",
            "developer_id" : 1,
            "developer_name" : "asd",
            "is_woman" : true,
            "session_id" : 114
        }
    ]
}

Expected behavior

2022-03-07T15:28:43.000000000Z

Actual behavior

2022-03-07T15:28:49.606396290Z

Additional info

No response

@tgirotto tgirotto added the bug unexpected problem or unintended behavior label Mar 7, 2022
@powersj
Copy link
Contributor

powersj commented Mar 7, 2022

Hmm, if you add "utc" to the list of included_keys does it resolve the issue?

customers id=449083,full_name="first customer" 1646666923000000000
[agent]
  omit_hostname = true

[[outputs.file]]

[[inputs.file]]
  files = ["test.json"]
  data_format = "json_v2"
  [[inputs.file.json_v2]]
    measurement_name = "customers"
    [[inputs.file.json_v2.object]]
      path = "data"
      timestamp_key = "utc"
      timestamp_format = "unix_ms"
      included_keys = [
        "id",
        "utc",
        "full_name",
      ]

@sspaink is there a better way to do this?

@powersj powersj added the waiting for response waiting for response from contributor label Mar 7, 2022
@sspaink
Copy link
Contributor

sspaink commented Mar 7, 2022

I don't think there is a better way to do this, your solution seems like the best approach.

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Mar 7, 2022
@sspaink sspaink added the waiting for response waiting for response from contributor label Mar 8, 2022
@telegraf-tiger
Copy link
Contributor

Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Page. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/influxdb bug unexpected problem or unintended behavior waiting for response waiting for response from contributor
Projects
None yet
Development

No branches or pull requests

3 participants