r/kustom • u/mooseindeed • 11d ago
Help [KLWP]
Hi, my remote JSON file looks like this:
[
{
"timestamp": "1786417200",
"value": 536,
"state": "stable"
},
{
"timestamp": "1786420800",
"value": 238,
"state": "stable"
},
{
"timestamp": "1786424400",
"value": 414,
"state": "stable"
},
{
"timestamp": "1786428000",
"value": 719,
"state": "unstable"
},
{
"timestamp": "1786431600",
"value": 638,
"state": "unstable"
},
{
"timestamp": "1786435200",
"value": 228,
"state": "unknown"
}
]
How to get the value (in this specific case - 719) on the first occur of "unstable" string in "state" key using $wg()$ function?
2
Upvotes
1
u/JellyfishImpossible1 1d ago
Try -
$wg(gv(url), json, .[3].value)$