I have an example here: viewtopic.php?t=198974#p1021503
e.g. It's tricky with .query in JSON. The comparison operators are all "stack based" (like an old HP RPN calculator). But AFAIK all operators should be at end of the array, working down the stack.
How .query work is semi-described in API docs as it follows Mikrotik older/non-HTTP API: https://help.mikrotik.com/docs/display/ ... PI-Queries – but seems you figured out that part.
e.g.
Code:
USER=admin ROUTER=192.168.88.1; curl -l -u $USER -X POST http://$ROUTER/rest/ip/firewall/nat/print -H "Content-Type: application/json" --data '{".query": ["chain=dstnat","chain=srcnat","#|!"]}'
How .query work is semi-described in API docs as it follows Mikrotik older/non-HTTP API: https://help.mikrotik.com/docs/display/ ... PI-Queries – but seems you figured out that part.
Statistics: Posted by Amm0 — Fri Feb 02, 2024 4:48 am