ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hi,
I am using a perl script to read the dansguardian access.log and output to an html file which I email to myself and other admins.
The site field can be humungus and I trim it down abit so one doesn't have to use the scroll bar to view the rest of the page.
For example:
Code:
http://toolbar.google.com/service/update?as=tbie&version=4.0.1020.6156&os=big&hl=en&tbbrand=SUNA&sd=com&osver=5.1&ossp=2.0&browser=6.0.2900.2180&rlz=1T4SUNA_en___US205&id=457FF06587E1BE25D4AC192011FA87B26DEACsQYIO&ds=1&lurslt=105,5,105,5,105 GET 146
I can get the basic information from that field and the next one using this perl code. This work fine, I just wondered if ther is a better, more correct way of doing this?
Thanks,
perl -v
This is perl, v5.8.8 built for i386-linux-thread-multi
that still pops the error...
Use of uninitialized value in concatenation (.) or string at ./test.pl line 83, <LOG_FILE> line 10697.
Just to clarify, I want to show everything up to the : in that field. If no : is there, just print what is there.
For example:
Code:
GET 7
GET 0
*DENIED* Banned site
Banned extension
*DENIED* Banned Phrase found
from these snips...
http://www.streamaudio.com/stations/player/pages/newplayer/nowplay/adtrack.asp?type=Replacement&adid=74158&station=WHKO_FM GET 7
http://ads1.msn.com/library/dap.js *DENIED* Banned site: ads1.msn.com GET 0
http://dl.google.com/toolbar/T4/data/en/big/4.0.1601.4978-big/GoogleNav.cab *DENIED* Banned extension: .cab GET 0
http://www.wlwt.com/index.html *DENIED* Banned Phrase found: gator GET 89562
http://oascentral.clearchannel.com/RealMedia/ads/adstream_sx.ads/wlw-am/home/@Top,Middle1,Left1!Top?_RM_HTML_LANDINGSITE_=www.700wlw.com *DENIED* Banned site: clearchannel.com GET 0
http://oascentral.clearchannel.com/RealMedia/ads/adstream_sx.ads/wlw-am/newsondemand/@Top,Middle1,Left1!Top?_RM_HTML_LANDINGSITE_=www.700wlw.com *DENIED* Banned site: clearchannel.com GET 0
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.