xslt - xmlstarlet extract values from Office 365 XML Files -
i attempting extract ipv4 addresses , urls each product in office 365 portfolio http://go.microsoft.com/fwlink/?linkid=533185. create input file updating firewall , proxy server rules.
snippet xml file
<?xml version="1.0" encoding="utf-8"?> <products updated="8/31/2016"> <product name="wac"> <addresslist type="ipv6"> <address>2a01:111:f406:8800::/64</address> <address>2a01:111:f406:400::/64</address> <address>2a01:111:f406:1c01::/64</address> <address>2a01:111:f406:9400::/64</address> <address>2a01:111:f406:2402::/64</address> <address>2a01:111:f406:a804::/64</address> <address>2a01:111:f406:b401::/64</address> <address>2620:1ec:c11::204</address> <address>2a01:111:202c::204</address> <address>2620:1ec:c11::205</address> <address>2a01:111:202c::205</address> </addresslist> <addresslist type="ipv4"> <address>13.69.187.20/32</address> <address>13.70.184.242/32</address> <address>13.71.155.176/32</address> <address>13.75.153.216/32</address> <address>13.76.140.48/32</address> <address>13.78.114.39/32</address> <address>13.85.84.102/32</address> <address>13.88.248.161/32</address> <address>13.88.254.212/32</address> <address>13.94.209.165/32</address> <address>23.103.183.15/32</address> <address>40.68.166.51/32</address> <address>40.74.130.243/32</address> <address>40.74.138.42/32</address> <address>40.76.54.124/32</address> <address>40.86.230.88/32</address> <address>40.114.192.209/32</address> <address>40.117.226.146/32</address> <address>40.126.236.216/32</address> <address>40.127.79.139/32</address> <address>52.169.109.48/32</address> <address>52.172.13.171/32</address> <address>52.172.153.104/32</address> <address>52.175.25.142/32</address> <address>52.232.128.169/32</address> <address>104.40.225.204/32</address> <address>104.41.62.54/32</address> <address>104.211.103.207/32</address> <address>104.211.229.230/32</address> <address>104.214.38.136/32</address> <address>104.215.194.17/32</address> <address>134.170.27.86/32</address> <address>134.170.48.20/32</address> <address>134.170.48.22/32</address> <address>134.170.65.86/32</address> <address>134.170.170.86/32</address> <address>137.116.172.39/32</address> <address>137.135.65.72/32</address> <address>191.235.87.181/32</address> <address>191.237.40.220/32</address> </addresslist> <addresslist type="url"> <address>*.officeapps.live.com</address> <address>*.cdn.office.net</address> </addresslist> </product> <product name="sway">
i have figured out out list products can used cycle through products end result can seem past filtering on particular product , ipv4 address.
./xmlstarlet sel -t -m '/products/product' -v @name -n downloads/o365ipaddresses.xml wac sway planner yammer onenote officeipad officemobile proplus rca lyo spo office365video identity exo crls o365 eop
i have tried many variations of following , no output.
./xmlstarlet sel -t -m '//root/products/product[name="wac"]/addresslist[type="ipv4"]' downloads/o365ipaddresses.xml
ultimately text file has following.
wac,ipv4,13.69.187.20/32 wac,ipv4,13.70.184.242/32 ..... ..... wac,url,*.officeapps.live.com
i can use csv file update collection of firewalls , proxy servers in company.
many in advance help.
Comments
Post a Comment