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

json_v2: tags required to be listed as included_keys #9394

Closed
igomura opened this issue Jun 17, 2021 · 0 comments · Fixed by #9406
Closed

json_v2: tags required to be listed as included_keys #9394

igomura opened this issue Jun 17, 2021 · 0 comments · Fixed by #9406
Assignees
Labels
area/json json and json_v2 parser/serialiser related bug unexpected problem or unintended behavior

Comments

@igomura
Copy link
Contributor

igomura commented Jun 17, 2021

Relevant telegraf.conf:

[[inputs.file]]
  files = ["/tmp/ctrl.json"]
  data_format = "json_v2"
  [[inputs.file.json_v2]]
    measurement_name = "storcli_controller"
    [[inputs.file.json_v2.tag]]
    path = "Controllers.#.Command Status.Controller"
    rename = "Controller"
    [[inputs.file.json_v2.object]]
    path = "Controllers.#.Response Data"
    disable_prepend_keys = true
    included_keys = [
      "Drive_Groups",
      "Virtual_Drives"
    ]
    tags = [
      "Product_Name",
      "Serial_Number"
    ]

System info:

Telegraf: telegraf-1.19.0-0.1.x86_64
OS: Linux localhost 3.10.0-1160.15.2.el7.x86_64 #1 SMP Wed Feb 3 15:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Steps to reproduce:

  1. Create json_v2 input
  2. add "included_keys" option
  3. add "tags" option

Expected behavior:

metrics, if found, should be tagged by tags from the list

Actual behavior:

Metrics are not tagged

Additional info:

In order to work all tags should be added to the "included_keys" list as below

    included_keys = [
      "Drive_Groups",
      "Virtual_Drives",
      "Product_Name",
      "Serial_Number"
    ]
    tags = [
      "Product_Name",
      "Serial_Number"
    ]

This is kind of obvious action and could be done by default.

@igomura igomura added the bug unexpected problem or unintended behavior label Jun 17, 2021
@MyaLongmire MyaLongmire self-assigned this Jun 21, 2021
@Hipska Hipska added the area/json json and json_v2 parser/serialiser related label Feb 15, 2022
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 bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants