in reply to Re^2: perl script
in thread perl script

Please use <code>...</code> tags around that log file, and paste only an interesting excerpt, not so much (didn't I write that before, too?), and use the preview button.
My question is-- if i give a username say 01214225 to the script, the script should be able to tell me all the information this user has done. The script should be able to take multiple log files. i need to print the all the information related to a given user with time stamp.i am showing it for QnAModule::authenticate. like this there can be 3 more Modules and they are Entering OTPAuthModule::authenticate and Entering UPAuthModule::authenticate. So if i give a username, the script should give the all the information related to that user with time stamp.

That's still no question, that's a task description. We're happy to help you with perl questions, but we won't write the code for you. Show some effort, post what you have tried so far, and tell us where you ran into difficulties.

Replies are listed 'Best First'.
Re^4: perl script
by namishtiwari (Acolyte) on May 28, 2009 at 13:21 UTC
    Hi, I grep for the username and i found the data in the log file and found out which session id it belongs, i will give you a sample of the output--
    Tue May 19 23:46:29.946 2009 Morocco Standard Time INFO: pid 2172 t +id 688: 17: 10088781: ArAuthFrameworkImpl::doPreAuth::1:10088781:: Au +thentication mechanism returned [0] for AuthIdentity [01402629;ARCARD +] Tue May 19 23:47:14.165 2009 Morocco Standard Time INFO: pid 2172 t +id 3352: 17: 10088815: ArAuthFrameworkImpl::doPostAuth::1:10088815:: +Authentication mechanism returned [1] for AuthIdentity [01402629]
    here 10088781,10088815 are the session id's related to this user id. i used this code to find it out
    #!/usr/bin/perl -w $username = "01402629"; open(VALUE, "< arcotwebfort_20May09_00_03_55.log"); @stock = <VALUE>; @matches = (grep(/$username/, @stock)); print @matches;
    i need some help in finding out this session-id is related to what mechanism, as i mentioned earlier there are OTPAuthentication,QnA and UPauth,so beased on the session-id i need to print which mechanism he belongs and what did he do in that with time stamps. Sory to bother you but u can copy that log file in some etxt file and wrapped the data. Thanks NT
    A reply falls below the community's threshold of quality. You may see it by logging in.