Hi,
this may seem like a dumb question, but I have tried many expressions that didn't yield what I was looking for.
Take for example the output of
ubus call network.wireless status
where you get nodes with the name of the wifi devices (e.g. "radio0" and "radio1"):
{
"radio0": {
...
},
"radio1": {
...
}
}
If you don't know the names of the nodes, how can you select the n-th (first, second, etc.) node on that level?
If I'm looking at deeper nested child nodes, this is easy. These two commands would, for example, return the first and second interface configured on radio1:
ubus call network.wireless status | jsonfilter -e "@.radio1.interfaces[0]" # first interface on radio1
ubus call network.wireless status | jsonfilter -e "@.radio1.interfaces[1]" # second interface on radio1
But I couldn't figure out, how to select the elements on the level of "radio0", "radio1", etc. Expressions like @[0] and many other variations I tried, didn't work.
As an alternative: Is there a way to just get the names of the nodes, so I can select them individually by name?
Thanks,
Timo