bimleshsharma has asked for the wisdom of the Perl Monks concerning the following question:
I have a log file having xml messages and other stuffs. I want to get all xml messages from log with some condition, Example: all xml messages having book="abc".
<test> <name> 111 </name> <book> 234 </book> </test> <test> <name> 111 </name> <book> abc </book> </test>
So from above i want set of xml message having attribute "<book> abc </book>"
I tried below concept but it is not printing filtered one, instead of that it is printing all xml messages.
open(CP,"<cpsFile.log") while(<CP>) { my $line= $_; if($line =~ m{<FXSlim} .. m{</FXSlim>}){ $soapLine.=$_; } print TRADE "$soapLine";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Fetch particular xml message from log
by choroba (Cardinal) on Sep 12, 2013 at 09:18 UTC | |
by bimleshsharma (Beadle) on Sep 12, 2013 at 17:29 UTC | |
|
Re: Fetch particular xml message from log
by poj (Abbot) on Sep 12, 2013 at 07:52 UTC | |
|
Re: Fetch particular xml message from log (twig)
by Anonymous Monk on Sep 12, 2013 at 06:30 UTC |