How to find one partucular user logs when there are lots of users running on it


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to find one partucular user logs when there are lots of users running on it
# 1  
Old 10-06-2008
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  
Old 10-06-2008
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  
Old 10-06-2008
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  
Old 10-06-2008
Quote:
Originally Posted by otheus
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  
Old 10-07-2008
Quote:
Originally Posted by ksr.test
by above grep command we are getting the lines which contains that particular user id right ?
Yes. .
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to rename lots of files with find?

Can someone help me with this script. I have a bunch of files like this: "2209OS_02_Code" "2209OS_03_Code" "2209OS_04_Code" "2209OS_05_Code" "2209OS_06_Code" "2209OS_07_Code" "2209OS_08_Code" "2209OS_09_Code" "2209OS_10_Code" "2209OS_10_video" and I want to rename them to be like this: ... (2 Replies)
Discussion started by: siegfried
2 Replies

2. UNIX for Advanced & Expert Users

Need to find the user id of all users in UNIX

I need to find all the unix user id's of all the users in unix... is there any such command... pl help out (6 Replies)
Discussion started by: Syed Imran
6 Replies

3. Red Hat

Collecting logs by running command

Hi, i am a general user of linux but we work mostly on windows next i am moving full time on linux. here is my question: We have product which consist or several subsystem each subsystem has one module to create logs file dump. and i am going to write that support dump tool. we need to... (3 Replies)
Discussion started by: ajayyadavmca
3 Replies

4. UNIX for Dummies Questions & Answers

logs of commands performed by users

Hi, when 2 users are logged as root , how can i find witch one had perform witch command? Thanks, (1 Reply)
Discussion started by: prpkrk
1 Replies

5. Shell Programming and Scripting

Lots of logs to move....don't remove if open

I have a ksh script that currently moves a day's worth of log files (about 15,000) files to a different directory. The issue is that about 100 of these files are still open for write when this happens. I need an efficient way to ensure that these files aren't open without doing an lsof on each... (7 Replies)
Discussion started by: nestafaria
7 Replies

6. Shell Programming and Scripting

Find username of user running the script

Hello All, If I have a simple cgi script and want to find the name of the person accessing the page, is it possible? How do I get the name of this user? Please help. I was trying a vague method but it doesn't seem to work with all browsers and versions ... $val=$ENV{'HTTP_COOKIE'}; $name... (1 Reply)
Discussion started by: garric
1 Replies

7. UNIX for Dummies Questions & Answers

Process launched by user who logs out, continue running ?

Lets say a user starts a process (either a shell script or a Perl script) and before that process finishes, he logs out (either intentionaly or network problems or ...), does the process continu running ? Default shell is Korn. This is because at my job (being trained), there are tasks to run... (2 Replies)
Discussion started by: Browser_ice
2 Replies

8. UNIX for Dummies Questions & Answers

How to prevent root users from editing files (logs)

How to prevent root users from editing files (logs)? Is there any way? (4 Replies)
Discussion started by: vehchi
4 Replies

9. UNIX for Dummies Questions & Answers

su - user... how to find out the list of users and their passwords..

hi, to do a su - user, we need to know what are the users... so in unix 1) which file to see the list of users, passwords? (2 Replies)
Discussion started by: yls177
2 Replies
Login or Register to Ask a Question