Hi All,
I have a very large json file which is an output of an api call to fetch firewall rules from my fw. I need to process the json file, find a specific value is a description field. then store the corresponding rule ID value from the entry that matches. I have been messing with python_scripts and pyscript modules seems there are limitations with certain functions like get etc.
any suggestion on how I can approach this will be appreciated.
here is sample of the Json File
{
"code": 200,
"status": "ok",
"response_id": "SUCCESS",
"message": "",
"data": [
{
"id": 0,
"type": "reject",
"interface": ["lan"],
"ipprotocol": "inet",
"protocol": null,
"icmptype": null,
"source": "any",
"source_port": null,
"destination": "pfB_PRI1_v4",
"destination_port": null,
"descr": "pfB_PRI1_v4",
"disabled": false,
"log": true,
"statetype": "keep state",
"tcp_flags_any": false,
"tcp_flags_out_of": null,
"tcp_flags_set": null,
"gateway": null,
"sched": null,
"dnpipe": null,
"pdnpipe": null,
"defaultqueue": null,
"ackqueue": null,
"floating": false,
"quick": null,
"direction": null,
"tracker": 1770009341,
"created_time": 1722967240,
"created_by": "Auto",
"updated_time": 1723300215,
"updated_by": null
},
// More rules here...
]
}