Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Extract Block Of Text From Log

by LanX (Saint)
on Nov 20, 2018 at 22:44 UTC ( [id://1226083]=note: print w/replies, xml ) Need Help??


in reply to Re: Extract Block Of Text From Log
in thread Extract Block Of Text From Log

> Though most people would probably nest flip-flops:

Here a demonstration:

use strict; use warnings; my $count=0; while (<DATA>) { if ( /^<13>/ .. /^END OF REPORT$/ ){ if (/\*\sparameters after change\s\=/ .. /\*\sNRG location\s\= +/) { print "$count: $_"; } } else { $count++ } } __DATA__ <13>Nov 13 17:27:25 OamCOMM[12260]: TIMESTAMP=Tue Nov 13 17:27:25 2018 MSGCLS=OAMOPE Title=OAM Create OPERATION Severity=Inform message={username:xxxx@::xxxx:xxx.xxx.xxx.x; causeDISTINGUISH_NAME=epsProfileId=xxxxx,pSProfileDataId=x,subscripti +onProfileD +ataId=x,managedElementId=xxxx USER_LABEL= ******************* parameters after change =******************* epsMaxRequestedBandwidthUL=xxxxxxxxx epsMaxRequestedBandwidthDL=xxxxxxxxx epsQosAllocRetPrioVulnerabilit=xxxxxxx epsQosAllocRetPrioCapability=xxxxxxx epsQosAllocRetPrioLevel=xxxxxxxxx epsQosClassId=xxxxxx sessionTimeout=xxxxxxx idleTimeout=xxxx epsChargingCharacteristics=xxxxxx epsVplmnDynamicAddrAllowed=xxxxxxxxxx epsGwAllocType=xxxxxx epsPdnType=xxxxxx epsAccessPointName=xxxxxx.xxxxxxx ******************* NRG location =******************* NRG_KEY=x } Message Id=10011 END OF REPORT <13>Nov 13 17:27:25 OamCOMM[12260]: TIMESTAMP=Tue Nov 13 17:27:25 2018 MSGCLS=OAMOPE Title=OAM Create OPERATION Severity=Inform message={username:xxxx@::xxxx:xxx.xxx.xxx.x; causeDISTINGUISH_NAME=packetDataProtocolProfileId=xxxxx,gPacketProtoc +olProfileD +ataId=x,pSProfileDataId=x,subscriptionProfileDataId=x,managedElementI +d=xxxx USER_LABEL= ******************* parameters after change =******************* meanThroughPutClass=xxxxxx peakThroughPutClass=xxxxx reliabilityClass=xxxx delayClass=xxxx precedenceClass=xxxxx hSDPAguaranteeFlag=x hSUPAguaranteeFlag=x hSUPAflag=x hSDPAflag=x downlinkGuaranteedBR=xxx uplinkGuaranteedBR=xx trafficHandlingPriority=xxxxxxx transferDelay=xx ratioSduError=xxxx residualBER=xxxx downlinkMaxBR=xxx uplinkMaxBR=xx maxSduSize=xxx deliveryOfErroneousSdu=xx deliveryOrder=xx trafficClass=xxxxxxxx priorityOfUmtsBearer=xxxxxxx vplmnAddressAllowedFlag=x pdpChargingCharacteristic=xxxxxx accessPointName=xxxxxx.xxxxxxx pdpType=xxxx ******************* NRG location =******************* NRG_KEY=x } Message Id=10011 END OF REPORT

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1226083]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found