Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

What i need to do is i want to display the logs in this format like :-

(1)For LogIn:- XYZ,1,799,tds,e86979ff-dea7-4771-8f43-df6a65a25054:2,192.168.32.95.


(2) For LogOut:- XYZ,9,799,1,192.168.33.99:57809

where XYZ suppose is the server name, 1 stands for login id , 799 is userid, tds is suppose user name, and after that it is transaction ID and Client IP at last which is 192.168.32.95 for example.Similarly, for logout 9 is the logout id, 799 is userid, 1 is count means how many users are logged out of the system. And after that follows, Client IP. How to solve this ??


Can anyone provide me with some type of code. I need it urgently, i am stuck over here.
Thanks.
Posted
Updated 6-Feb-15 23:30pm
v2
Comments
Richard MacCutchan 5-Feb-15 6:07am    
What logs are you talking about?
Member 11072130 5-Feb-15 6:17am    
Logs from my company's one of the Server and i need to display in above mentioned format.However, what i need is i need to filter out the logs and i just want to display logs from only say "XYZ" server of my company.
Richard MacCutchan 5-Feb-15 6:29am    
How do you expect anyone to answer that? We have no idea what these logs are or where they come from. Please provide proper details of the information you are processing and how you access it.
Member 11072130 5-Feb-15 6:36am    
Sir, as shown above the log is coming from multiple servers and we need to filter out the logs and we need to display logs for only say "XYZ" server, as i can't name the server here. We need to show for this specific server "XYZ" the above mentioned info like userid, username, client ip and so on.
Richard MacCutchan 5-Feb-15 6:46am    
OK, so what exactly is the problem? You have the data, you know the format, so all you need to do is write a program to parse each line and produce the reports.

1 solution

If you're having the API to login the user, and to log the user out, then upon a successfull login or logout function call, you can log the data of the user. I am unable to determine what sort of method you're using to store the data (that GUID, and the Time object you're using inside the string), what I can suggest is to serialize the data of the login and log out information, and then save it inside the file (which-so-ever you're using to log the data for each successfull transaction; by trasaction I mean process of login or log out for users). You can get the IP address, Time of the login or log out of the user from the network and the GUID can be generated in the framework you're using; which you've not specified.

You are supposed to include a basic example of working (or faulty) code in your post, for us to invesitage and then help you out. It would help us in providing a better solution to you.
 
Share this answer
 
Comments
Member 11072130 5-Feb-15 6:20am    
We don't have any API's to do this. What i want is to filter out the logs from a group of Server and display logs for only say "XYZ" server and thus display login and logout information for this server.
Afzaal Ahmad Zeeshan 5-Feb-15 6:28am    
Ok, do you have any authentication or any function that would let you know when a user logs in or out of server "XYZ"?
Member 11072130 5-Feb-15 6:39am    
Not actually Sir, we need to display the logs in GUI type environment that is in my company's workstation. Where i am confusing here are how can i filter out the logs from multiple server and get to display only logs for XYZ server only. Is there any way to insert the "Filter" in C++?? If yes, how ??
Afzaal Ahmad Zeeshan 5-Feb-15 7:47am    
I am sorry, I didn't get your point before. Yes C++ allows you to do such action, and you can filter the servers in your data. One thing you need to do is to specify the name of the server, and select only the data for the server "XYZ". You can create an object of Log (maybe a class) and then select where the name of the server matches the "XYZ".
Member 11072130 5-Feb-15 8:10am    
Ok Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900