The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
rm: Unable to remove directory /mnt/users/test/logs/: File exists solitare123 UNIX for Dummies Questions & Answers 4 08-12-2008 02:14 PM
Find username of user running the script garric Shell Programming and Scripting 1 06-10-2008 12:44 AM
Process launched by user who logs out, continue running ? Browser_ice UNIX for Dummies Questions & Answers 2 08-08-2006 06:43 AM
How to prevent root users from editing files (logs) vehchi UNIX for Dummies Questions & Answers 4 12-06-2005 03:29 PM
su - user... how to find out the list of users and their passwords.. yls177 UNIX for Dummies Questions & Answers 2 11-13-2002 04:07 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-06-2008
Registered User
 

Join Date: Sep 2008
Posts: 12
How to find one partucular user logs when there are lots of users running on it

On my application there are lots of users are doing there work or tasks? ...In my SSH or in 'Putty' i am observing logs?
Hot to observe one particular 'user' logs.. even through there are lots of users working on it?

For EX: i am log in with use rid:nikhil@in.com. another one log in with john@in.com another one with another uid,pwd... etc i am doing my business on it like that another one doing their business? But under logs the contents is comming continuosly like mixed with all other users .... here i want to see only contents of login with my useid here it is nikhil@in.com.

my commands for seeing logs are here : tail -f logs/application.log

logs is dir
application.log is logs file.

it would be appreciated if any one help in this regard..
Reply With Quote
Forum Sponsor
  #2  
Old 10-06-2008
Registered User
 

Join Date: Mar 2008
Location: /bin/sh
Posts: 352
well it would depend, on how the data is logged.

You might be having the user name logged in the log file. Why don;t you grep the log file on that particular user.
Reply With Quote
  #3  
Old 10-06-2008
otheus's Avatar
Moderator ala Mode
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 605
You can just grep the output of tail:

Code:
USER=john
RHOST=in.com
tail -f logs/application.log | grep "user $USER"
The other thing you can do is install pam_script and set up a "onsessionopen" and "onsessionclose" script which will generate such a logfile, and is guaranteed to run (unless sshd is killed with -9).
Reply With Quote
  #4  
Old 10-06-2008
Registered User
 

Join Date: Sep 2008
Posts: 12
Quote:
Originally Posted by otheus View Post
You can just grep the output of tail:

Code:
USER=john
RHOST=in.com
tail -f logs/application.log | grep "user $USER"
The other thing you can do is install pam_script and set up a "onsessionopen" and "onsessionclose" script which will generate such a logfile, and is guaranteed to run (unless sshd is killed with -9).
by above grep command we are getting the lines which contains that particular user id right ?
Reply With Quote
  #5  
Old 10-07-2008
otheus's Avatar
Moderator ala Mode
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 605
Quote:
Originally Posted by ksr.test View Post
by above grep command we are getting the lines which contains that particular user id right ?
Yes. .
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:46 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0