Hello @phill, so I think the issue is that you need to escape the quotes around Router like so: path = "devices.#(DEVICE_TYPE==\"Router\")#" then the json_v2 parser should work as expected.
@sspaink Duh! So obvious, I completely missed it. I’m new to GJSON and got too buried in this fancy pattern matching feature to remember good ole 'Coding 101 '.
Yep, I use VS Code and just installed the TOML extension before changing the code. Though it didn’t flag this particular error (before I escaped the inner quotes).
On a related topic: The parsing examples show 4 spaces of indent rather than 2 for typical TOML. E.G.,
[[inputs.http.json_v2]]
measurement_name = "abc"
[[inputs.http.json_v2.object]]
path = "whatever"
Is that a convention or a requirement? Personal preference would have me use 2 spaces throughout.
Thanks!