How to access array-indices with json_parser operator? #26121
Unanswered
FWinkler79
asked this question in
Q&A
Replies: 1 comment
-
If you know how many items the array has, you can do:
After this, attributes.agents.foo gives you access to the objects. I'm running into the same issue with an array with a varying number of items, has anyone found a solution for that? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I am struggling to find out how to access json objects that are within an array using json_parser.
What I have is a structure like this (in the attributes field):
... and there may potentially be many such object.
Now with json_parser I was trying to do the following:
But this will fail at startup of the collector, with the following error:
When I use quotes to embrace the array index (0) the collector will start but not extract the first object in the array.
What's the proper syntax to access array indices?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions