Parsing Large XML files with Perl Script
I'm having to parse through large XML files containing IP addresses both IPv6 and IPv4 as well as hostnames (origins) and datacenter names. The XML format is pretty unreadable and I would like to take those values and display them in a more friendly way.
I had a similar post previously and would like to emulate the same kind of behavior if possible.
<Sorry, I can't seem to link URLs until I've posted 15 or more> :(
This time the variables have changed and a I'd like to add a few minor things to the script since the data is a little different.
Okay so first off, an example of the data that I'm trying to parse:
Occasionally there will be a resource name containing both an IPv4 and an IPv6 address as the "value" and sometimes just an alias name for the "value". But regardless the authoritative factor would be "origin name" that either "value" types would fall under, ex:
<resource name="adminservice-s1-blu" value="adminservice-s1-blu.msoc.nsack.net" />
So there are 5 variables that I'm hoping to be outputted in a clean fashion so I can compare which origin names have IP addresses, either v4 or v6 and be able to see what Role, Role Name, and Data Center those origins belong to.
<resource name="BLU-ADM-PROC-Anchor" value="18.104.22.168" />
<resource name="ipv6_bba100-anchor" value="2001:222:f400:f00::66" />
- role name
- datacenter name
- origin name
Sorry if this seems convoluted in any way, but it's just easier for me to see a clean output from such a huge XML database.
Thanks so much!