[squid-users] script /usr/lib/squid3/log_db_daemon

Tony Peña emperor.cu at gmail.com
Tue Feb 9 10:23:41 UTC 2016


Hi

I want to modify the /usr/lib/squid3/log_db_daemon script, but I'm not know
very knowledge about PERL, so if i want to modify to get on the mysql
table, not epoch_time, and date_time in human readable i guess first change
the scheme...

line 157:    " time_since_epoch     DECIMAL(15,3),"
to :    " time_since_epoch     DATEFIELD"

after that add the new field for mac will be: mac CHAR(17)
i want to add MAC in the log so this is the part i need help

1st need to explain to squid have to log mac address, with >eui BUT by
default hasn't and on the script can't see where is setup..... so .. where
can i customize that..?

is ok this line on the script to add mac regexp ?? i use this regexp on the
python script and works but on PERL i hope so on too. need a review

sub parse($) {
    my ($line) = @_;
    my (@t) = $line =~ /^L(\d+\.\d+) *(\d+?)
(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
(.*?)
(.*?)\/(\d+?) (\d+?) (.*?) (.*?) (.*?) (.*?)\/(.*?) (.*)$/;
}

i think if i change the datetime field the regexp must be change too..
how can i end my little modify?

thanxs in advance.
-- 
perl -le 's ffSfs.s fSf\x54\x6F\x6E\x79 \x50\x65\x6e\x61f.print'

Secure email with PGP 0x8B021001 available at https://pgp.mit.edu
<https://pgp.mit.edu/pks/lookup?search=0x8B021001&op=index&fingerprint=on&exact=on>
Fingerprint: 74E6 2974 B090 366D CE71  7BB2 6476 FA09 8B02 1001
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20160209/c998813c/attachment-0001.html>


More information about the squid-users mailing list