Sorry for such code, I'm just getting starting with perl and on perlmonks.org. So, line that should be passed to a ban() script as is, if regexp matches:

1325521875.165 93 127.0.0.1 TCP_MISS/302 667 GET http://www.google.co.uk/sorry/?continue=http://www.google.co.uk/search%3Fq%3Just+an+axample - ROUNDROBIN_PARENT/proxy_218 text/html

my @cutoff = grep /proxy_/,@_; s/ROUNDROBIN_PARENT\///g for @cutoff; @cutoff = grep /@cutoff/,@cfg;
Should left in @cutoff after second line: proxy_218 In third line script must search against squid.conf strings with proxy_218, and it shuould find:

cache_peer 111.222.121.1 parent 60099 0 no-query no-digest originserver name=proxy_218 round-robin login=login:pass connect-timeout=3

cache_peer_access proxy_218 allow all

These lines must be moved to some file, and squid must be reloaded. I've executed my script like this:

# ./MY__SCRIPT.pl 1325521875.165 93 127.0.0.1 TCP_MISS/302 667 GET http://www.google.co.uk/sorry/?continue=http://www.google.co.uk/search%3Fq%3Just+an+axample - ROUNDROBIN_PARENT/proxy_218 text/html


In reply to Re^6: Real time log parser by kazak
in thread Real time log parser by kazak

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.