suggestions require for unix system performance on certain task


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users suggestions require for unix system performance on certain task
# 1  
Old 04-13-2007
suggestions require for unix system performance on certain task

Dear all,

On my UNIX server there is an apache web log file. The rate of logging of data in this file is very high. I want to extract user logging log from this file in run time. As soon as the user logging log logged in this file I want to redirect this user log into another file.

I want to know which following method is more correct (system performance wise, cpu usage etc ) to do above explained task:

1. Do a ‘tail -f apache.log | <awk pattern to redirect the user logging log into another file>', this command will run as a daemon.
2. Write a Perl script which run as a daemon and continuously scan the file and if the user logging appeared and time stamp is new then fetch that log information and redirect it to another file.

Or is there any other way which is more efficient than above two specified?

Thanks in advance

Regards...
Zing_foru
# 2  
Old 04-13-2007
If I'm restricted to choose from those two options, I'd go for the first one but there's more efficient way to accomplish this with apache logs - with SetEnvIF - take a look at this page, there are pretty good examples.
# 3  
Old 04-24-2007
Hi sysgate

Thanks for providing the link.

I have gone trough the Apache log page that you provided. But still I am having some problems.

I studied the httpd.conf file which is on my server. The httpd.conf file already contain one CustomLog line.

Can I add one more CustomLog line as follows

CustomLog "|grep LaunchPage.nhtml" 2>&1 >> /tmp/user.log

Or is there any new configuration option to get only user logging and user loggout logs in a separate file?

Thanks and Regards...
zing_foru
# 4  
Old 04-24-2007
I don't think you can use "grep" in SetEnvIf directive, honestly, I've done this two years ago, but I forgot how exactly...let me check the old files...In the meantime, you may check this liink and see if it will help.
# 5  
Old 04-26-2007
I just checked some old config files... If you want to do Name Based Hosting, respectively user, just add vhost directive like :
Quote:
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
Here you can add the path to the logs, and then wiht some mod_rewrite you can achieve the goal.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

System performance

Hi I need to know the system performance : # echo "::memstat" | mdb -k Page Summary Pages MB %Tot ------------ ---------------- ---------------- ---- Kernel 358022 2797 9% ZFS File Data 2427072 18961 59% Anon 1096938 8569 27% Exec and libs 12020 93 0% Page cache 73859 577 2% Free... (4 Replies)
Discussion started by: dimitris
4 Replies

2. UNIX for Dummies Questions & Answers

UNIX based / like OS suggestions to dual boot with Windows

Hello everybody! I'm a long-time windows user with some very limited experience with some Linux distributions. I'm a programmer (in training), but I've worked mostly with .NET stuff. I started a new job a couple of weeks ago and was issued a MacBook Pro to work on. I have fallen in love with the... (3 Replies)
Discussion started by: egill
3 Replies

3. UNIX for Dummies Questions & Answers

Require interview questions on UNIX

Hi Unix experts, I require interview questions on UNIX. Tomorrow I have to interview a guy of 2yrs experienced. So I require the Q&A's. Please provide the questions in a manner from Basics to Advanced with grading. We mostly use that guy for Unix shell scripting (support, maintenance). ... (1 Reply)
Discussion started by: karumudi7
1 Replies

4. HP-UX

system performance

hi every body i want to check system performance i usually use glance,top,sar and swapinfo but i confused in something so i need explanation about memory issue first i want check the memory usage i used glance i found this parameter so i need one shows me the differences between these... (2 Replies)
Discussion started by: maxim42
2 Replies

5. Shell Programming and Scripting

comment and Uncomment single task out of multiple task

I have a file contains TASK gsnmpproxy { CommandLine = $SMCHOME/bin/gsnmpProxy.exe } TASK gsnmpdbgui { CommandLine = $SMCHOME/bin/gsnmpdbgui.exe I would like to comment and than uncomment specific task eg TASK gsnmpproxy Pls suggest how to do in shell script (9 Replies)
Discussion started by: madhusmita
9 Replies

6. Shell Programming and Scripting

Performance problem with my script ...suggestions pls

Hi , I have included my script below, pls read thro this req. I want my script to run for every hour , the problem is I CANNOT USE CRONTAB which is prohibited inside the company. My script does what it is supposed to do (to determine the memory and then send a email if it crosses a certain... (2 Replies)
Discussion started by: vivsiv
2 Replies

7. UNIX for Dummies Questions & Answers

Need Help !....pls i require All n Everything About Unix -History,Development..evrthg

i need to know abt Unix Development,History,Features n Everything..... :confused: (2 Replies)
Discussion started by: Shank
2 Replies

8. Linux

system performance

Anyone know how to fetch the system performance information by the function except the system command? These information includes CPU load,memory usage,network load,disk capacity,etc. (5 Replies)
Discussion started by: Frank2004
5 Replies

9. UNIX for Dummies Questions & Answers

Help! Suggestions on what I can I use my 2 unix boxes for?

Once upon a looong time ago I used to work with Unix systems - SGI mainly. Now I've inherited 2 boxes - an SGI dual processor Octane and an Indigo2. For the past 2 years they've sat waiting for me to do something with them and never getting round to it. I run a windows network at home so... (3 Replies)
Discussion started by: JimmyChang
3 Replies

10. UNIX for Dummies Questions & Answers

Unix File System performance with large directories

Hi, how does the Unix File System perform with large directories (containing ~30.000 files)? What kind of structure is used for the organization of a directory's content, linear lists, (binary) trees? I hope the description 'Unix File System' is exact enough, I don't know more about the file... (3 Replies)
Discussion started by: dive
3 Replies
Login or Register to Ask a Question