arpita has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I am beginner to Perl. Needs a help on processing the log file.
Here is the content of file.
2015-03-27 20:39:49,796 ERROR MPesa 7002 webServices 10.201.12.200- [M +P27203801969209][301a8a0e-bb59-4182-9a4b-79abbb3ed39a][payBillRecharg +eAllOperator][McomSendSMSServiceImpl][callSpiceSMSApi] - Exit Method +with status Map : {smsFlag=true, errorMsgs=null, status=SUCCESS} for +msisdn : 9431641426 2015-03-27 20:39:49,796 ERROR MPesa 7002 webServices 10.201.12.200- [M +P27203801969209][301a8a0e-bb59-4182-9a4b-79abbb3ed39a][payBillRecharg +eAllOperator][SmsDataHelper][setSmsData] - Exiting method setSmsData +for Msisdn : 9431641426 with SMS Flg : true
In above file I need to check for the Pattern [MP27203801969209] and pick that value and the corresponding 9431641426 value in the end. Picking these value I need to put this combination in another file. Also value "[MP27203801969209]" is not hard coded so I have to check for this block [MP[1-9]] in each line.
Please suggest the perl code for the same.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Regular Expression Issue
by Corion (Patriarch) on Sep 07, 2015 at 11:04 UTC | |
|
Re: Perl Regular Expression Issue
by AnomalousMonk (Archbishop) on Sep 07, 2015 at 13:39 UTC | |
|
Re: Perl Regular Expression Issue
by u65 (Chaplain) on Sep 07, 2015 at 12:31 UTC | |
|
Re: Perl Regular Expression Issue
by NetWallah (Canon) on Sep 08, 2015 at 01:00 UTC | |
by Anonymous Monk on Sep 08, 2015 at 10:52 UTC |