1st custom json input - no _fields

Hi,

I’m like using telegraf and influx to create some fancy dashboards in grafana. At the moment I just use pre-build plugins to collect my data.

Now I want to collect information from our windows-patch management. I want to know on which client some patches are missing. I get the data in a .json file like this:

[
{
    "ComputerName":  "client-A",
    "LastUser":  "user-1",
    "Patches_missing":  17,
    "LastScanDate":  "\/Date(1619215370000)\/",
    "Query_time":  1619519048063
},
{
    "ComputerName":  "client-B",
    "LastUser":  "user-2",
    "Patches_missing":  0,
    "LastScanDate":  "\/Date(1619216735000)\/",
    "Query_time":  1619519048063
},
{
    "ComputerName":  "client-C",
    "LastUser":  "user-3",
    "Patches_missing":  5,
    "LastScanDate":  "\/Date(1619215386000)\/",
    "Query_time":  1619519048063
}
]

The part of my telegref.conf looks like this:

[[inputs.file]]
  files = ["/path/to/my/file.json"]
  data_format = "json"
  name_override = "patches_missing"
  tagexclude = ["host"]
  json_string_fields = ["LastUser", "LastScanDate"]
  tag_keys = ["ComputerName"]
  json_time_key = "Query_time"
  json_time_format = "unix_ms"

If I test that configuration, there were no error and the file is being parsed:

> patches_missing,ComputerName=client-A LastScanDate="/Date(1619215370000)/",LastUser="user-1",Patches_missing=17 1619519048000000000
> patches_missing,ComputerName=client-B LastScanDate="/Date(1619216735000)/",LastUser="user-2",Patches_missing=0 1619519048000000000
> patches_missing,ComputerName=client-C LastScanDate="/Date(1619215386000)/",LastUser="user-3",Patches_missing=5 1619519048000000000

Now I want to use the Data Explorer to create some querys but in _measurement “patches_missing” I can see all my clients, but they have no _fields.

Can you give me a hint to get this working?

Greetings

Hello @Vogelbecker,
That’s very odd.
Can you please share a screenshot of what you’re seeing?
Can you try changing the date selector to include more values from the past/make sure that your query includes those data points? Does it include any values for your other fields?