Hi,
I have a log file having n number of xml's like the one below.
<uOStatus xmlns:env="http://abc.org/def/ghi/" xmlns:soapenv="http://abc.def.org/soap/envelope/"><ID>12345</ID><oID>A123</oID><Identifier><aID>ABC</aID><sID>ABCID</sID><sVersion>1</sVersion><timeStamp1>2013-05-07T09:04:05.849</timeStamp1><rID>A123</rID><cID/><iID/></Identifier><oStatus><opStatus><status>NO_ACTION_REQUIRED</status><dc/><olStatus><olID/><olpStatus/><old/></olStatus></opStatus><dc>EC [1] ED [Success]</dc></oStatus><ccs/></uOStatus>
I want to check the oID of the xml's from the log. If the 0ID=A123 then i want to check the value of status.
I tried the below code to pull the xml from the logs.
awk '/<status/ { N++ } N; /<\/status/ { N-- }' log > uOStatuslog
If I use the below code I am able to pull only the oID values but I will not be able to check the value of status for this oID.
perl -lne 'BEGIN{undef $/} while(/(<oID>(.*?)<\/oID>)/sg) {$x=$1; print $x if $2 =~ /A123/}' uOStatuslog > oIDlog
Regards
Neethu