![]() |
| ||
| simple scripting question, CGI log hello, i use a simple log script on my site.. very basic.. i would like to modify it, and am having issues.. here is what i would like... i would like to be able to have it filter out certian HOST names.. but not exact.. say for instance, i dont want it logging yahoo slurp.. the host name changes, but always ends in yahoo.com so, i would like to filter out djfdk.388338.djdk.yahoo.com and i would like to be able to add more than one, a list of filtered hosts, not IP's, that will not be logged.. so, i would like to change the $me var, to host, but not exact host, just domain (like i stated earlier) and then to create a list, by coma. thanks a bunch pj here is the script: #!/usr/bin/perl |
| ||
| Re: simple scripting question, CGI log anyone?? |
| ||
| Re: simple scripting question, CGI log Sorry, I have read your question three times and I can't understand what you want to do. |
| ||
| Re: simple scripting question, CGI log Hey dude Let me repharse ur question, Sorry if i understood wrong If log is having aaa.ccc.ddd.eee.Yahoo.com dfsdfsdsdf.gmail.com Then u like to have only yahoo.com gmail.com is this u are looking for ? |
| ||
| Re: simple scripting question, CGI log So I'm assuming you are looking for things that "end with" such and such, that being the case a simple regular expression might do? if ($line =~ m/yahoo.com/i) { if ($line =! m/^(www.|http:\/\/).yahoo.com/i) { print $line . "\n"; } That line will basically take and do a search on anything containing yahoo.com (case insensitive) then if it doesn't start with, www.yahoo.com, or http://yahoo.com print the line out. I'm not sure if that helps, hope it does |
| All times are GMT -4. The time now is 3:24 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC