nicopelle has asked for the wisdom of the Perl Monks concerning the following question:
Hi to all perlmonks users, and thanks all and in particular to whom will waste some minutes with my silly questions
I'm really losing my mind with a file formatted like this:
<?xml version="1.0" encoding="UTF-8"?> <ctgStatistics xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ctgstatslog.xsd"> <statRecord type="interval" length="60" time="2019-07-16T08:23:59"> <resourceGroup name="CSCS1SVGM1"> <statistic type="Startup"> <name>SPROTOCOL</name> <value type="String">TCPIP</value> </statistic> <statistic type="Lifetime"> <name>LCONNFAIL</name> <value type="Integer">0</value> </statistic> <statistic type="Lifetime"> <name>LLOSTCONN</name> <value type="Integer">0</value> </statistic> <statistic type="Lifetime"> <name>LIDLETIMEOUT</name> <value type="Integer">0</value> </statistic> <statistic type="Lifetime"> <name>LALLREQ</name> <value type="Integer">0</value> </statistic> <statistic type="Lifetime"> <name>LREQDATA</name> <value type="Long">0</value> </statistic> <statistic type="Lifetime"> <name>LRESPDATA</name> <value type="Long">0</value> </statistic> <statistic type="Current"> <name>CREQCURR</name> <value type="Integer">0</value> </statistic> <statistic type="Current"> <name>CWAITING</name> <value type="Integer">0</value> </statistic> <statistic type="Current"> <name>CORPHANREQ</name> <value type="Integer">0</value> </statistic> <statistic type="Lifetime"> <name>LORPHANREQ</name> <value type="Integer">0</value> </statistic> <statistic type="Current"> <name>CTERM</name> <value type="Integer">0</value> </statistic> <statistic type="Lifetime"> <name>LTERMINST</name> <value type="Integer">0</value> </statistic> <statistic type="Lifetime"> <name>LTERMUNINST</name> <value type="Integer">0</value> </statistic> <statistic type="Lifetime"> <name>LAVRESP</name> <value type="Integer">0</value> </statistic> <statistic type="Startup"> <name>SIPADDR</name> <value type="String">amlif700txs001</value> </statistic> <statistic type="Startup"> <name>SIPPORT</name> <value type="Integer">28218</value> </statistic> </resourceGroup> <resourceGroup name="CSCS1SVGM1"> ..... <resourceGroup name="ANOTHER_ONE_AND_SO_ON> ... </resourceGroup> </statRecord> </ctgStatistics>>
The data::dumper config is:
$VAR1 = { 'xsi:noNamespaceSchemaLocation' => 'ctgstatslog.xsd', 'statRecord' => [ { 'resourceGroup' => { 'CSCS1GFVM1' => { ' +statistic' => { + 'LRESPDATA' => { + 'value' => { + 'content' => '0', + 'type' => 'Long' + }, + 'type' => 'Lifetime' + }, + 'CREQCURR' => { + 'type' => 'Current', + 'value' => { + 'type' => 'Integer', + 'content' => '0' + } + }, + 'SIPADDR' => { + 'value' => { + 'type' => 'String', + 'content' => 'amlif700txs +001' + }, + 'type' => 'Startup' + }, + 'LLOSTCONN' => { + 'type' => 'Lifetime', + 'value' => { + 'type' => 'Integer', + 'content' => '0' + } + }, + 'CORPHANREQ' => { + 'value' => { + 'content' => '0', + 'type' => 'Integer'
This file contains 24h statistics, and the size is 82Mb (one file each day).
There is a section:
every 60secs.<statRecord type="interval" length="60" time="2019-07-16T08:23:59">
time|resourceGroup name|LCONNFAIL|LLOSTCONN|LIDLETIMEOUT|SIPADDR|SIPPO +RT 2019-07-16T08:23:59|CSCS1SVGM1|0|0|0|amlif700txs001|28218 ..and..so..on..until.the.on.file.
I've just tried XML::Twig, XML::LibXML and use Data::Dumper with XML::Simple(which is not so simply for me;-) ) with no success :(.
Thanks, again, to anyone who want to show me the right path/way to follow.
|
---|