expvarmon icon indicating copy to clipboard operation
expvarmon copied to clipboard

vars: monitor the Nth object of an array

Open arl opened this issue 7 years ago • 1 comments

I can't find a way to monitor a variable located in an object inside an array, see the following JSON:

"Blah": {
    "DeviceStatus": [
        {
            "Descr": "Foo",
            "ConnectionStatus": false,
        },
        {
            "Descr": "Bar",
            "ConnectionStatus": false,
        }
    ]
}

I tried with:

expvarmon  -vars="Foo:Blah.DeviceStatus[0].ConnectionStatus"

but the UI gives me:

Blah.DeviceStatus[0].ConnectionStatus: N/A

arl avatar Jun 15 '18 11:06 arl

Hey @arl, this feature is unsupported.

I wonder, where is the expectation of [0] to work with JSON comes from – from jq experience? Other tooling? I'm asking because if many people expect similar behaviour, maybe it will make sense to basically duplicate the jq syntax or something like it.

And, of course, PRs are always welcome.

divan avatar Jun 27 '18 13:06 divan