i got the sessionID's from this,they are-10088781,10088815. like this there are plenty of sessionID related to a single user.

i collected this information in an array @matches. now i want to take sessionID's from this array and search for the sessionID in the logfile which AuthMechanism it belongs to. There are three-four AuthMechanism to which a user can belong.they are-- QnAModule::authenticate UPAuthModule::authenticate UPAuthModule::authenticate

On the basis of these mechanisms i need to know the user belongs to which mechanism. This part is very tricky for me and i am stuck here as i am not well wersed with Perl and learning it. I will upload my logfile. please suggest me to proceed further. If my questions are not clear to you please let me know i will try to explain them better.Please help me in proceeding further, i am also trying to write it myself. What i want is what the given user is doing in the session id and the session id is related to which mechanism.

So let say my script takes username as arguememnt, i am able to print all the information that is related to that user with sessionID's. this sessionID is related to diffrent Authentication mechanism mentioned earlier.The user can belong to any or all mechanisms.my basic criteria is that the user belongs to which mechanism and he is doing what(data related to the username in mechanisms) The output should be like this-- say i gave the input username as 01018603, i will be able to get the output as-- the example belongs to one AuthMechanism ie QnA

Quote

if [ sessionID_No_Got_from_the_username_list == QnA sessionID ]; then print all the data inside that sessionID that relates to user with timestamp print this also Handle_NSPAdvice:: Handling NSPAdvice for mechanism [2] with time stamp.

1. How are you relating session ids to users? Is the user id listed in the logfile or do you have a separate list?

2. How are the session ids related to authentication methods? Again, is this information available in the logfile or do you have a separate list? I don't see anything like "QnAModule", etc. in the file you uploaded.

Thanks for paying attention to my problem. I am stuck at this place and not able to proceed.i cna only upload 250kb of file and my logfile is quite huge. Regarding your queries the answers are below--

1.. Yes userID is is listed in the logfile by name userName. When we search for the userName, it gives us details about the userName and which sessionID's it belongs.SessionID comes after tid value and leaving one more field after that,consisting of 8digits. each seesion id gives us the details about which mechanism it belongs to. 2. Each sessionID belongs to a mechanism,if we specifically search for the SessionID's it will show the details like this.

Thi sdetails will simply tell us which mechanis it belong as we can see the lines like "QnA Session Id :[1:10081229]" in the sessionID related data. This information is available in the logfile. QnAModule is there in the logfile uploaded. I think now question will be much clear,if not still kindly tell me. and i will try to elaborate more.I am again uploading the logfile.txt file.

1. How are you relating session ids to users? Is the user id listed in the logfile or do you have a separate list?

2. How are the session ids related to authentication methods? Again, is this information available in the logfile or do you have a separate list? I don't see anything like "QnAModule", etc. in the file you uploaded.

Thank You very much for paying attention to my problem and helping me for my problem. I was not in office due to some family casuality and could not reply.

Except for QnA Module authentication the user name is coming like this --

so it is clear that pattern is not common for all but they are diffrent.

In this script i want to pass user name as command line arguement and i want to pass multiple log files not just one. I want to print the timestamp also and what the user was doing in the authentication module. I am thankful for your kind help. Any kind of help is greatly appericiated.

i need suggestion in passing multiple log files not just one, as in my case there are multiple log files for the span of a day. is it possible to use metacharacters in the logfile name like- if i enter logfile* it will pick all the files matching this. You are an expert in this field so your sugegstion will be very valueable to me.how i can get the timestamp because in this case it seems very difficult to me.

Easy-peasey. The perl glob() command is what you're looking for. You'll need to pass the log directory and log prefix to your script instead of a file name and add an outer loop to handle the multiple files. Perhaps something like:

Ok, think about your problem. Your latest requirement is to output 1 record for each session. This is actually easier, since you no longer need to group statistics by AuthMethod. Furthermore, since logfile entries naturally occur in timestamp order, you don't even need to sort your output!

What this means is you can throw away the $authenticates hash altogether and print each output line as soon as you parse it.

Ok, think about your problem. Your latest requirement is to output 1 record for each session. This is actually easier, since you no longer need to group statistics by AuthMethod. Furthermore, since logfile entries naturally occur in timestamp order, you don't even need to sort your output!

What this means is you can throw away the $authenticates hash altogether and print each output line as soon as you parse it.

Easy-peasey. The perl glob() command is what you're looking for. You'll need to pass the log directory and log prefix to your script instead of a file name and add an outer loop to handle the multiple files. Perhaps something like:

Thank you very very much. It did work,but in temp1 file it did not pasted the whold data for all the files, though in file results.txt everything is coming. The results.txt file shows that 3 files are processed and it collected the information which is printed in the code but in temp1 data for only 1 file is coming not for all. Is there something wrong in the code or temp1 need to be handeled in a diffrent way.

At line 10 you're re-opening temp1 in overwrite mode for each file. Move the open/close statements outside the loop on logFile.

UPDATE: This would have been more apparent to both of us if you properly indented your code.

Cheers,

Larry

Thank You for your valueable suggestions and your patience. I am really thankful to you as you made me to learn so many things. I changed the mode to append mode and it worked fine. Still plenty of part is left, so will need your help in near future.