Grep xml messages from log file using perl

This script will grep lines in between the log
Basically GREP is command to get a line
but here we are trying to get set of xml messages from log which is in scattered manner.
All hash lines are for special use.

open FH, “<spine.xml" ;
my $xml;

while () {
#if ( my $count = m{first tag} .. m{last tag} ) {
if ( m{first tag} .. m{last tag} ) {
$xml .= $_;
#if ($count =~ /E0\z/) {
# process($xml);
# $xml = undef;
#}
}
}
print $xml;

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: