I have a JSON file where every JSON object has a unique identifier (IP Address)
When given a range of IP Addresses, I want to filter the Original JSON based on the given range and store it in a new file. (i.e All the JSON objects having an IP Address that falls in the given Range)
JSON File:
[{
"Name": "SERVER1",
"ipv4Address": "192.168.0.50",
"OperatingSystem": [],
"OperatingSystemServicePack": null,
"OperatingSystemVersion": "6.3 (9600)"
},
{
"Name": "SERVER2",
"ipv4Address": "192.168.0.51",
"OperatingSystem": [],
"OperatingSystemServicePack": null,
"OperatingSystemVersion": "6.3 (9600)"
},
{
"Name": "SERVER3",
"ipv4Address": "192.168.0.52",
"OperatingSystem": [],
"OperatingSystemServicePack": null,
"OperatingSystemVersion": "6.3 (9600)"
},
{
"Name": "SERVER4",
"ipv4Address": "192.168.0.53",
"OperatingSystem": [],
"OperatingSystemServicePack": null,
"OperatingSystemVersion": "6.3 (9600)"
},
{
"Name": "SERVER5",
"ipv4Address": "192.168.0.54",
"OperatingSystem": [],
"OperatingSystemServicePack": null,
"OperatingSystemVersion": "6.3 (9600)"
}]
If the given range were 192.168.0.52 - 192.168.0.54, the output should be:
[{
"Name": "SERVER3",
"ipv4Address": "192.168.0.52",
"OperatingSystem": [],
"OperatingSystemServicePack": null,
"OperatingSystemVersion": "6.3 (9600)"
},
{
"Name": "SERVER4",
"ipv4Address": "192.168.0.53",
"OperatingSystem": [],
"OperatingSystemServicePack": null,
"OperatingSystemVersion": "6.3 (9600)"
},
{
"Name": "SERVER5",
"ipv4Address": "192.168.0.54",
"OperatingSystem": [],
"OperatingSystemServicePack": null,
"OperatingSystemVersion": "6.3 (9600)"
}]