I'm trying to extract just the IPs from a filtered JSON using the following code:
$curl = Invoke-WebRequest -Method Get -Uri "http://urltojson.com/file.json"
$curl2 = $curl.Content.replace("Script", "Script_").replace("iphone", "iphone_").replace("android", "android_").replace("ipad","ipad_") | ConvertFrom-Json
$curl3 = $curl2 | Where-Object {$_.Name -eq "/Common/cloudfront_nets"} | Select-Object -ExpandProperty data
$curl3
[System.Collections.ArrayList]$curl3[0] = $curl3
$curl3[1]
Which returns the following
13.59.250.0 255.255.255.192 : region: us-east-2-service: CLOUDFRONT
52.57.254.0 255.255.255.0 : region: eu-central-1-service: CLOUDFRONT
54.182.0.0 255.255.0.0 : region: GLOBAL-service: CLOUDFRONT
52.212.248.0 255.255.255.192 : region: eu-west-1-service: CLOUDFRONT
205.251.250.0 255.255.254.0 : region: GLOBAL-service: CLOUDFRONT
35.162.63.192 255.255.255.192 : region: us-west-2-service: CLOUDFRONT
13.32.0.0 255.254.0.0 : region: GLOBAL-service: CLOUDFRONT
205.251.254.0 255.255.255.0 : region: GLOBAL-service: CLOUDFRONT
I'm struggling to simply output the IPs (without the subnet-mask)
Can anyone help please ?