[Solved] Jsonata function help

Hello all. I have a perplexing issue. Someone on here told me about jsonata and it has been very helpful so far. I am not that advanced yet in it. I have some json output. and I can get the jsonata output that I almost want.
My current jsonata string is "scanners.[name,last_connect,status,engine_version,ui_version,scan_count]"

However I have multiple groups with type local or managed. I ONLY want to see items of the above string from type= managed

If I do this it only reports back true or false which is not helpful
"scanners.[type='managed']&[name,last_connect,status,engine_version,ui_version,scan_count]"

Is there anyway to filter the json listed below on if type = managed then show name , last_connect, status, engine_version, ui_version, scan_count
data fields have been purposely skewed to hide information but the structure is the same

redacted

Please provide some usable data, the example data above is not valid json.

I believe you are very close. It should work if you replace the "&" by a dot

scanners[type='managed'].[name,last_connect,status,engine_version,ui_version,scan_count]

1 Like

I can't do that. This is an excerpt of server data and I can't give you the real names.
It should be still valid json. Will look over it might have accidentally removed a ' or " or ) somewhere upon putting in just jibberish values

man you're right I was close! thanks for the advice :slight_smile: :slight_smile: This fixed it :slight_smile:

3 Likes