Hi,
I tried to use the input file plugin with json_v2 parser but I did not find exactly how to configure it.
My json input looks like:
[
{
“benchmark” : “B1”,
“primaryMetric” : {
“score” : 109.57272003762402
}
},
{
“benchmark” : “B2”,
“primaryMetric” : {
“score” : 103.2295949532184
}
}
]
And I want to generate something like below:
micro-benchmark benchmark=“B1” score=109.57272003762402 1668873524000000000
micro-benchmark benchmark=“B2” score=103.2295949532184 1668873524000000000
The following configuration allow to generate something near to what I want but without tag benchmark, difficulty comes when I want to add the tag benchmark.
[[inputs.file.json_v2]]
measurement_name = “micro-benchmark”
timestamp_format = “unix_ns”
timestamp_timezone = “Europe/Paris”
[[inputs.file.json_v2.field]]
path = “@this.#.primaryMetric.score”
I also tried with json_v2.object but without getting the expected result.
If someone have some hints, thank to share them