The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: suggestions require for unix system performance on certain t
AGS
Newbie
Rank: 1



UID 40
Digest Posts 0
Credits 0
Posts 12
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 14, 2007 09:08 AM  Profile | P.M. 
suggestions require for unix system performance on certain t



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 ail 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?


Top
kjmcculloch
Newbie
Rank: 1



UID 225
Digest Posts 0
Credits 0
Posts 34
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 14, 2007 09:08 AM  Profile | P.M. 
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.
Top
Monty
Newbie
Rank: 1



UID 268
Digest Posts 0
Credits 0
Posts 19
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 14, 2007 09:08 AM  Profile | P.M. 
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.
Top
Hyena
Newbie
Rank: 1



UID 180
Digest Posts 0
Credits 0
Posts 7
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 14, 2007 09:09 AM  Profile | P.M. 
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.
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:30 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.607277 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP