The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 05:14 PM
Find username of user running the script garric Shell Programming and Scripting 1 06-10-2008 03:44 AM
Process launched by user who logs out, continue running ? Browser_ice UNIX for Dummies Questions & Answers 2 08-08-2006 09:43 AM
How to prevent root users from editing files (logs) vehchi UNIX for Dummies Questions & Answers 4 12-06-2005 06: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 07:07 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-06-2008
ksr.test ksr.test is offline
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..
  #2 (permalink)  
Old 10-06-2008
nua7 nua7 is offline
Registered User
  
 

Join Date: Mar 2008
Location: /bin/sh
Posts: 353
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.
  #3 (permalink)  
Old 10-06-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,884
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).
  #4 (permalink)  
Old 10-06-2008
ksr.test ksr.test is offline
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 ?
  #5 (permalink)  
Old 10-07-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,884
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. .
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0