Greetings everyone. I’ve been trying for days to grab the IP addresses from a json file. I have JParseFunctions script loaded but can’t get any data output using the loader in Terminal cli. I read & tried various cli commands (deserialize, JSLoad) on this forum but nothing has worked.
Can someone please provide some assistance parsing the “cidr” data from a local json file & put the results in a plain text file with a new line for each result in raw, without the quotes. This will be ran in a scheduled script. The source json file will be downloaded on the router via scheduled script as well. Or, if it’s more efficient, can be combined to download the json file & parse the cidr data in new text file in an all in one script.
ROS: 7.16.1 & 7.15.2
Link to json file (source): https://www.spamhaus.org/drop/drop_v4.json
Downloaded json file (source) will be named: SpamHaus_drop_v4.json
Format of json file:
{“cidr”:“1.10.16.0/20”,“sblid”:“SBL256894”,“rir”:“apnic”}
{“cidr”:“1.19.0.0/16”,“sblid”:“SBL434604”,“rir”:“apnic”}
{“cidr”:“1.32.128.0/18”,“sblid”:“SBL286275”,“rir”:“apnic”}
New plain text file (dest) named: SpamHaus_drop_v4.txt
Link to JParseFunctions: https://github.com/Winand/mikrotik-json-parser