Hello all,
I've performed a major upgrade to my Squid logfile analysis script. Here are
a few of the new features:
* Supports both Squid 1.0 and Squid 1.1 native logfile format
* Shows the most popular sites, both by requests and traffic
* Neighbor, method and object type statistics
* A weekly report, for those who have diskspace and CPU time to burn, like me.
* Shows the timespan of the logfile, and the analysis time
* Shows the hitrate; both for requests and traffic
I'm struggling to get the report inside 80 character columns. At the moment
it spans 90 columns... (my terminal has 100 columns)
Duane assigned the name "access-flow" to the initial version of this script,
which is ok with me. Version 0.2 and 0.3 never left my serial line :)
You need:
* A logfile in Squid's native format
* GNU awk (nawk might be ok too, I don't know)
* the script attached below
Please let me know what you think of the output. Is there useful info missing,
or does it contain too many numbers?
Enjoy, Richard.
begin 640 proxy_stats.gawk
M0D5'24X@>PH)8F%D;&EN97,@/2`P"@EN=6UD96YI97,@/2`P"@EA;F%L>7-I
M<U]S=&%R="`]('-Y<W1I;64H*0H)9FER<W1R97$@/2!A;F%L>7-I<U]S=&%R
M=`H);&%S=')E<2`](#`*"@EF87-T>&9E<B`](#,N,"`J(#$P,#`*"71O=&%L
M<W1R(#T@(D%L;"!R97%U97-T<R(*?0I["@EI9B`H3D8@/3T@.2D@>R`@("`C
M(%-Q=6ED(#$N,2!N871I=F4@;&]G(&9O<FUA=`H)"71I;65S=&%M<"`]("0Q
M"@D)96QA<'-E9"`]("0R"@D)8VQI96YT(#T@)#,*"0EI9B`H<W!L:70H)#0L
M(&-O9&5S+"`O7"\O*2`A/2`R*2!["@D)"6)A9&QI;F5S*RL*"0D);F5X=`H)
M"7T*"0EL;V-A;"`](&-O9&5S6S%="@D)<W1A='5S(#T@8V]D97-;,ET*"0ES
M:7IE(#T@)#4*"0EM971H;V0@/2`D-@H)"75R;"`]("0W"@D):61E;G0@/2`D
M.`H)"6EF("AS<&QI="@D.2P@:&EE<BP@+UPO+RD@(3T@,BD@>PH)"0EB861L
M:6YE<RLK"@D)"6YE>'0*"0E]"@D):&EE<F%R8VAI92`](&AI97);,5T*"0EN
M96EG:&)O<B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#X@;&%S
M=')E<2D@;&%S=')E<2`]('1I;65S=&%M<`H)=V5E:VYR(#T@:6YT*'1I;65S
M=&%M<"`O(#8P-#@P,"D*"6EF("@A*'=E96MN<B!I;B!W965K87-C*2D@=V5E
M:V%S8UMW965K;G)=(#T@<W1R9G1I;64H(B59+R5M+R5D(BP@=V5E:VYR("H@
M-C`T.#`P*0H)=V5E:R`]('=E96MA<V-;=V5E:VYR70H*"6QT<EML;V-A;%T@
M*ST@,0H);'AR6VQO8V%L72`K/2!I<WAF97(*"6QX8EML;V-A;%T@*ST@>&9E
M<F)Y=&5S"@EL>'1;;&]C86Q=("L]('AF97)T:')O=6=H<'5T"@EL:');;&]C
M86Q=("L](&ES:&ET"@EL:&);;&]C86Q=("L](&AI=&)Y=&5S"@H)<W1R6W-T
M871U<UT@*ST@,0H)<WAR6W-T871U<UT@*ST@:7-X9F5R"@ES>&);<W1A='5S
M72`K/2!X9F5R8GET97,*"7-X=%MS=&%T=7-=("L]('AF97)T:')O=6=H<'5T
M"@ES:');<W1A='5S72`K/2!I<VAI=`H)<VAB6W-T871U<UT@*ST@:&ET8GET
M97,*"@EH=');:&EE<F%R8VAI95T@*ST@,0H):'AR6VAI97)A<F-H:65=("L]
M(&ES>&9E<@H):'AB6VAI97)A<F-H:65=("L]('AF97)B>71E<PH):'AT6VAI
M97)A<F-H:65=("L]('AF97)T:')O=6=H<'5T"@EH:');:&EE<F%R8VAI95T@
M*ST@:7-H:70*"6AH8EMH:65R87)C:&EE72`K/2!H:71B>71E<PH*"71T<EMT
M;W1A;'-T<ET@*ST@,0H)='AR6W1O=&%L<W1R72`K/2!I<WAF97(*"71X8EMT
M;W1A;'-T<ET@*ST@>&9E<F)Y=&5S"@ET>'1;=&]T86QS=')=("L]('AF97)T
M:')O=6=H<'5T"@ET:');=&]T86QS=')=("L](&ES:&ET"@ET:&);=&]T86QS
M=')=("L](&AI=&)Y=&5S"@H)=W1R6W=E96M=("L](#$*"7=X<EMW965K72`K
M/2!I<WAF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I;'1E<@H)"0EE;'-E('!R:6YT9B`B)34N,68E)2`B+"!H8EMC72]X8EMC
M72HQ,#`@?"!F:6QT97(*"0EI9B`H>');8UT@/3T@,"D@<')I;G1F("(@("`@
M("T@("`@("`M7&XB('P@9FEL=&5R"@D)"65L<V4@<')I;G1F("(E-BXQ9B`E
M-BXQ9EQN(BP@>&);8UTO,3`R-"]X<EMC72P@>'1;8UTO,2XP,C0O>');8UT@
>?"!F:6QT97(*"7T*"@EC;&]S92AF:6QT97(I"GT*
`
end
Received on Sun Sep 08 1996 - 12:39:04 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:32:58 MST