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
Performance problem with my script ...suggestions pls vivsiv Shell Programming and Scripting 2 02-23-2008 12:25 AM
Need Help !....pls i require All n Everything About Unix -History,Development..evrthg Shank UNIX for Dummies Questions & Answers 2 02-15-2008 10:37 AM
system performance Frank2004 Linux 5 12-18-2007 08:34 PM
Help! Suggestions on what I can I use my 2 unix boxes for? JimmyChang UNIX for Dummies Questions & Answers 3 09-16-2007 09:55 AM
Unix File System performance with large directories dive UNIX for Dummies Questions & Answers 3 03-12-2004 02:31 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-13-2007
Registered User
 

Join Date: Mar 2007
Posts: 36
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
Reply With Quote
Forum Sponsor
  #2  
Old 04-13-2007
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
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.
Reply With Quote
  #3  
Old 04-24-2007
Registered User
 

Join Date: Mar 2007
Posts: 36
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
Reply With Quote
  #4  
Old 04-24-2007
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
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.
Reply With Quote
  #5  
Old 04-26-2007
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
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.
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 09:46 AM.


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