I have a json file with IP address and other data. I try to parse it with JParseFunctions (https://github.com/Winand/mikrotik-json-parser). The script running well on terminal, but I don't know how to make it works on /System/Scripts.
JSON code
Code: Select all
{
"ip": "108.177.16.30",
"hostname": "30.r1.unverified-forwarding.1e100.net",
"city": "Brussels",
"region": "Brussels Capital",
"country": "BE",
"loc": "50.8505,4.3488",
"org": "AS15169 Google LLC",
"postal": "1000",
"timezone": "Europe/Brussels"
}
My script
Code: Select all
{
:global JSONLoad;
:global parsedIP "X";
:set parsedIP {
return (:put ([$JSONLoad "ipaddress-api.json"]->"ip"))
}
:log warning $parsedIP;
}
Thanks in advance