![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling a perl script from a perl script | new2ss | Shell Programming and Scripting | 6 | 05-24-2009 06:03 PM |
| How to Turn perl one-liners into full perl script? | EDALBNUG | UNIX for Dummies Questions & Answers | 1 | 02-04-2009 10:49 AM |
| [Perl] Accessing array elements within a sed command in Perl script | userix | Shell Programming and Scripting | 2 | 10-03-2008 01:05 PM |
| Include PERL script with in the unix shell script | ganapati | UNIX for Dummies Questions & Answers | 1 | 04-29-2008 01:18 PM |
| Perl: Run perl script in the current process | vino | Shell Programming and Scripting | 10 | 12-09-2005 10:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
Perl Script Help
Hi Experts,
I need help in writing a perl script which can help me in doing the following.... 1. Read the user name and session id from the sample log file provided. 2. Print the header as risk_assesment for userid(value). 2. Print the line containing End-to-end time in miliseconds. 3. There are thoudands of user and i have to calculate the time taken for all the users. The entry for the user name starts at the point where these lines are [CODE] Next State: risk_assessment 2009-02-18 00:00:11,687 [TP-Processor11] DEBUG BaseController,(TP-Processor11:301) - Next state: assessrisk.htm Session id can be found in there. The portion of the log file for the one user id and session id is below--- Code:
2009-02-18 00:00:11,687 [TP-Processor11] INFO FlowController,(TP-Processor11:121) - Next State: risk_assessment
2009-02-18 00:00:11,687 [TP-Processor11] DEBUG BaseController,(TP-Processor11:301) - Next state: assessrisk.htm
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG RFRiskAssessmentController,(TP-Processor11:122) - Entered callRF
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG RFRiskAssessmentController,(TP-Processor11:122) - Found DID cookie for RF.
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG RFRiskAssessmentController,(TP-Processor11:122) - Returning DID: FXIbNjt4llWFmvPKHSGZoMvZ60WQTd5vFZ3Em+J2jbkZfMHoJxI0XAcDcZfy5G6F
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG RFRiskAssessmentController,(TP-Processor11:122) - Username: 01376128
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG RFRiskAssessmentController,(TP-Processor11:122) - Groupname: MLS
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG RFRiskAssessmentController,(TP-Processor11:122) - Device Signature:
{"DEVICESIG":{"VERSION":"1.5","OS_BROWSER":{"browser_ver":"3.0.6","os":"PPC Mac OS X 10.4","browser":"Netscape"},"SCREEN":
{"colorDepth":"24","availWidth":"1680","width":"1680","height":"1050","availHeight":"1024"},"HTTP_HEADER":
{"user-agent":"Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/3.0.6"},"OPTIONAL":
{"SOFTWARE":[]},"USER_PREF":{"sys_lang":"en-us","timezone":"480","user_lang":"en-us"}}}
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG RFRiskAssessmentController,(TP-Processor11:122) - DID retrieved from client system:
FXIbNjt4llWFmvPKHSGZoMvZ60WQTd5vFZ3Em+J2jbkZfMHoJxI0XAcDcZfy5G6F
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG RFRiskAssessmentController,(TP-Processor11:122) - IP Address: 216.75.232.70
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG RFRiskAssessmentController,(TP-Processor11:122) - INetAddress received: /216.75.232.70
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG RiskFactory,(TP-Processor11:140) - The object is already created
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG RiskXActionAPI,(TP-Processor11:120) - evaluateRiskAfterLogin: XML Request
[<POLICYREQ><MESSAGEID>0</MESSAGEID><CALLERID>4 - MLS - MLS: com.arcot.aok.web.controllers.rf.RFRiskAssessmentController</CALLERID>
<AUTHPARAMS><ACTION>LOGIN</ACTION><CREDENTIAL>ARCOTID</CREDENTIAL></AUTHPARAMS><IDENTITY>
<USERID>01376128</USERID><GROUP>MLS</GROUP><SUBGROUP>SUBGROUP2</SUBGROUP></IDENTITY>
<LOCATION><IPADDRESS>216.75.232.70</IPADDRESS></LOCATION>
<DEVICEID type="http">FXIbNjt4llWFmvPKHSGZoMvZ60WQTd5vFZ3Em+J2jbkZfMHoJxI0XAcDcZfy5G6F</DEVICEID>
<DEVICESIG>{"DEVICESIG":{"VERSION":"1.5","OS_BROWSER"
:{"browser_ver":"3.0.6","os":"
PPC Mac OS X 10.4","browser":"Netscape"},"SCREEN":
{"colorDepth":"24","availWidth":"1680","width":"1680","
height":"1050","availHeight":"1024"},"HTTP_HEADER":{"user-agent":"
Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/3.0.6"},"
OPTIONAL":{"SOFTWARE":[]},"USER_PREF":{"sys_lang":"en-us","
timezone":"480","user_lang":"en-us"}}}</DEVICESIG></POLICYREQ>]
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG SocketPool,(TP-Processor11:32) - borrowSocket: Trying to get lock localCallGetConnectionFlag false callGetConnectionFlag true
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG SocketPool,(TP-Processor11:37) - borrowSocket: In if(callGetConnectionFlag)
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG SocketPool,(TP-Processor11:68) - borrowSocket: Calling borrowObject
2009-02-18 00:00:11,734 [TP-Processor11] DEBUG PoolableSocketFactory,(TP-Processor11:195) - activateObject not supported : No action taken on Socket[addr=/172.16.64.30,port=7680,localport=3188]
2009-02-18 00:00:11,749 [TP-Processor11] DEBUG SocketPool,(TP-Processor11:70) - borrowSocket: Out of borrowObject
2009-02-18 00:00:11,749 [TP-Processor11] DEBUG SocketPool,(TP-Processor11:78) - borrowSocket: Calling Notify
2009-02-18 00:00:11,765 [TP-Processor11] DEBUG PoolableSocketFactory,(TP-Processor11:184) - Validating Object:Socket[addr=/172.16.64.30,port=7680,localport=3188]
2009-02-18 00:00:11,765 [TP-Processor11] INFO PoolableSocketFactory,(TP-Processor11:199) - passivateObject called on Socket[addr=/172.16.64.30,port=7680,localport=3188]
2009-02-18 00:00:11,765 [TP-Processor11] DEBUG PoolableSocketFactory,(TP-Processor11:184) - Validating Object:Socket[addr=/172.16.64.30,port=7680,localport=3188]
2009-02-18 00:00:11,765 [TP-Processor11] DEBUG RiskXActionAPI,(TP-Processor11:127) - evaluateRiskAfterLogin:
Response Packet [<POLICYSERVERDOC DATATYPE="XML"><POLICYRES><MESSAGEID>0</MESSAGEID><SESSIONID>1:2857064</SESSIONID>
<ACTION>ALLOW</ACTION><RESPONSECODE>0</RESPONSECODE><ERRORSTRING></ERRORSTRING>
<ERRORCODE>0</ERRORCODE><TRANSACTIONID>1:2857064</TRANSACTIONID><RISKSCORE>10</RISKSCORE>
<DEVICEID>FXIbNjt4llWFmvPKHSGZoMvZ60WQTd5vFZ3Em+J2jbkZfMHoJxI0XAcDcZfy5G6F</DEVICEID>
<RISKDETAIL></RISKDETAIL></POLICYRES></POLICYSERVERDOC>]
2009-02-18 00:00:11,765 [TP-Processor11] DEBUG ResponseMessageParser,(TP-Processor11:214) - Error code:0 ErrorMsg:TRANSACTIONID : 1:2857064
2009-02-18 00:00:11,765 [TP-Processor11] DEBUG ResponseMessageParser,(TP-Processor11:214) - Error code:0 ErrorMsg:SESSIONID : 1:2857064
2009-02-18 00:00:11,765 [TP-Processor11] DEBUG ResponseMessageParser,(TP-Processor11:259) - ArcotPacket MessageID [1]
2009-02-18 00:00:11,765 [TP-Processor11] DEBUG ResponseMessageParser,(TP-Processor11:140) - riskAnalysisBuildResponseFromXML:
DeviceID [FXIbNjt4llWFmvPKHSGZoMvZ60WQTd5vFZ3Em+J2jbkZfMHoJxI0XAcDcZfy5G6F]
2009-02-18 00:00:11,765 [TP-Processor11] DEBUG ResponseMessageParser,(TP-Processor11:141) - riskAnalysisBuildResponseFromXML: AggregatorID []
2009-02-18 00:00:11,765 [TP-Processor11] DEBUG ResponseMessageParser,(TP-Processor11:142) - riskAnalysisBuildResponseFromXML: RiskScore [10]
2009-02-18 00:00:11,765 [TP-Processor11] DEBUG ResponseMessageParser,(TP-Processor11:143) - riskAnalysisBuildResponseFromXML: Action [ALLOW]
2009-02-18 00:00:11,765 [TP-Processor11] DEBUG ResponseMessageParser,(TP-Processor11:144) - riskAnalysisBuildResponseFromXML: SessionId [1:2857064]
2009-02-18 00:00:11,765 [TP-Processor11] INFO RiskXActionAPI,(TP-Processor11:137) - evaluateRiskAfterLogin: donecom.arcot.riskfortAPI.RiskAssessment@25d8c5
2009-02-18 00:00:11,765 [TP-Processor11] INFO RiskXActionAPI,(TP-Processor11:59) - evaluateRisk: End-to-end time in millisecond 31
I put the things in red which is required, i think that will help you. Thanks NT Note: I edited the post to move code tags closer to logfile and to break up long lines Last edited by namishtiwari; 02-26-2009 at 04:04 AM.. Reason: moved code tags, broke up long log lines |
|
||||
|
wow.
Unless I'm missing something there doesn't seem to be anything to tie any of those lines together. If thats the case, you could create your script's logic to check for multiple variables, but thats looks to be hellish in this case also. So, if you have access to the code you could create your own "debugging" and make that so it that your debugging have a common value. Maybe you could just use the webserver's logs? Looking for the first and last connection? Is this app yours? Is it a vendor app? What language/code base is it? Is there a database? If there's a database you could use SQL to track your users. That log file doesn't look like it's going to help you. Good luck, Tom de |
|
||||
|
Quote:
Next State: risk_assessment And this must be the end: evaluateRisk: End-to-end time in millisecond 31 That would be easy enough to find, but hell if I'm going to try and decipher the rest of the lines in that file. If he can clarify better what records need to pulled from the file and show some effort I am willing to help. |
|
||||
|
I am not familiar with Perl much, though i know some shell scripting, i am trying to grep the records,but in perl we dont have that option.If you can help me out with some syntax that will me much appericiable.I need three values user name, session id and the end to end time printed. they are there in the records.
Thanks NT Last edited by namishtiwari; 02-25-2009 at 02:49 AM.. Reason: added some explanation |
|
||||
|
Perl is like grep on steroids. I understand what you are looking for, but I don't think you'll find it in the log/debug output you posted - for the reasons I've posted already.
So, do you have any answers to our posts? What have you tried already ( post code and output plz.). Tom de Last edited by Tom de; 02-25-2009 at 02:00 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|