как сделать cache.log в squid более человекопонятным? (squid в cache.log посылает неразбираемую кашу)

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модераторы: SLEDopit, Модераторы разделов

Аватара пользователя
McSim
Сообщения: 419
Статус: Экспериментатор
ОС: заGNU/Linux Debian

как сделать cache.log в squid более человекопонятным?

Сообщение McSim »

Доброго времени, камрады!
Пытаюсь побеждать сквид, но тяжело идет процесс.
Сквид использует negotiate аутентификацию. При этом, на некоторые сайты не пускает. Тупо страница долго загружается а потом часть HTML отображено, часть не загружено. пример сайта job.ru.
Попытался включить дебаг мальньеого уровня:

Код: Выделить всё

gw ~ # grep -v ^# /etc/squid3/squid.conf | grep -v ^$
auth_param negotiate program /usr/lib/squid3/squid_kerb_auth
auth_param negotiate children 10
auth_param negotiate keep_alive off
acl localnet src 10.0.0.0/16
acl post method POST
acl nocache dstdomain "/etc/squid3/acls/nocache.acl"
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl allusers proxy_auth REQUIRED
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl CONNECT method CONNECT
http_access allow post localnet
http_access allow manager localhost
http_access allow localhost
http_access allow allusers
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_port 10.0.0.10:3129
http_port 127.0.0.1:3129
tcp_outgoing_address 0.0.0.0
hierarchy_stoplist cgi-bin ?
cache_mem 512 MB
cache_dir ufs /var/spool/squid3 5000 16 256
minimum_object_size 3 KB
maximum_object_size 30000 KB
debug_options ALL,2   # дебаг
coredump_dir /var/spool/squid3
cache deny nocache
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320
visible_hostname gw
udp_outgoing_address 0.0.0.0
dns_nameservers 127.0.0.1
forwarded_for off
retry_on_error on

в /etc/squid3/acls/nocache.acl добавлен .job.ru.
при этом, в cache.log сквид посылает фарш, который невозможно разобрать, когда работает много пользователей, пример:
Spoiler

2012/03/14 12:33:13.765| The reply for GET http://bs.yandex.ru/informer/156828/3_0_FF...FFF_0_pageviews is ALLOWED, because it matched 'allusers'
2012/03/14 12:33:13.770| The request GET http://chat17.livetex.ru/?site_id=15998&..._=1331713993691 is ALLOWED, because it matched 'allusers'
2012/03/14 12:33:13.770| client_side_request.cc(547) clientAccessCheck2: No adapted_http_access configuration.
2012/03/14 12:33:13.770| client_side_request.cc(547) clientAccessCheck2: No adapted_http_access configuration.
2012/03/14 12:33:13.770| The request GET http://chat17.livetex.ru/?site_id=15998&..._=1331713993691 is ALLOWED, because it matched 'allusers'
2012/03/14 12:33:13.773| The reply for GET http://counter.yadro.ru/logo;HeadHunter?14.1 is ALLOWED, because it matched 'all'
2012/03/14 12:33:13.875| The request GET http://a.adwolf.ru/prepareCode?p1=yj&p...&pr1=437771 is ALLOWED, because it matched 'allusers'
2012/03/14 12:33:13.875| client_side_request.cc(547) clientAccessCheck2: No adapted_http_access configuration.
2012/03/14 12:33:13.875| The request GET http://a.adwolf.ru/prepareCode?p1=yj&p...&pr1=437771 is ALLOWED, because it matched 'allusers'
2012/03/14 12:33:13.879| The reply for GET http://chat17.livetex.ru/?site_id=15998&..._=1331713993691 is ALLOWED, because it matched 'all'
2012/03/14 12:33:13.880| ConnStateData::swanSong: FD 48
2012/03/14 12:33:13.899| ctx: enter level 0: 'http://www.google-analytics.com/__utm.gif?utmwv=5.2.5&utms=110&utmn=540874783&utmhn=hh.ru&utmcs=UTF-8&utmsr=1440x900&utmvp=1423x761&utmsc=24-bit&utmul=ru-ru&utmje=0&utmfl=11.1%20r102&utmdt=%D0%A0%D0%B0%D0%B1%D0%BE%D1%82%D0%B0%2C%20%D0%B2%D0%B0%D0%BA%D0%B0%D0%BD%D1%81%D0%B8%D0%B8%2C%20%D0%B1%D0%B0%D0%B7%D0%B0%20%D1%80%D0%B5%D0%B7%D1%8E%D0%BC%D0%B5%2C%20%D0%BF%D0%BE%D0%B8%D1%81%D0%BA%20%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D1%8B%20%D0%BD%D0%B0%20HeadHunter%20(hh.ru)&utmhid=1089796595&utmr=0&utmp=%2Femployer%2FvacancyesList.do&utmac=UA-11659974-2&utmcc=__utma%3D79533005.459974758.1331705929.1331705929.1331705929.1%3B%2B__utmz%3D79533005.1331705929.1.1.utmcsr%3Dkrasnodar.hh.ru%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F%3B&utmu=qAEg~'
2012/03/14 12:33:13.899| hdr cc: ignoring duplicate cache-directive: near 'no-cache=Set-Cookie, proxy-revalidate' in '0xbf989004'
2012/03/14 12:33:13.899| ctx: exit level 0
2012/03/14 12:33:13.899| hdr cc: ignoring duplicate cache-directive: near 'no-cache=Set-Cookie, proxy-revalidate' in '0xbf988cf4'
2012/03/14 12:33:13.899| The reply for GET http://www.google-analytics.com/__utm.gif?...&utmu=qAEg~ is ALLOWED, because it matched 'all'
2012/03/14 12:33:13.903| The request GET http://hh.ru/poster/763290.swf is ALLOWED, because it matched 'allusers'
2012/03/14 12:33:13.903| client_side_request.cc(547) clientAccessCheck2: No adapted_http_access configuration.
2012/03/14 12:33:13.903| The request GET http://hh.ru/poster/763290.swf is ALLOWED, because it matched 'allusers'
2012/03/14 12:33:13.903| The request GET http://hh.ru/poster/763290.swf is ALLOWED, because it matched 'allusers'
2012/03/14 12:33:13.930| The reply for GET http://a.adwolf.ru/prepareCode?p1=yj&p...&pr1=437771 is ALLOWED, because it matched 'all'
2012/03/14 12:33:13.973| The reply for GET http://hh.ru/poster/763290.swf is ALLOWED, beca


Тут невозможно что-либо выделить, отночительно источника запроса/пользователя и т.п.
Как можно разобрать данный лог?
Спасибо сказали:
Аватара пользователя
McSim
Сообщения: 419
Статус: Экспериментатор
ОС: заGNU/Linux Debian

Re: как сделать cache.log в squid более человекопонятным?

Сообщение McSim »

Мистика, на другом прокси 3.0.STABLE19, с конфигом:

Код: Выделить всё

[root@proxy ~]#  grep -v ^# /etc/squid3/squid.conf | grep -v ^$
acl manager proto cache_object
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443    # HTTPS
acl Safe_ports port 80    # HTTP
acl Safe_ports port 901    # SWAT
acl Safe_ports port 631    # CUPS
acl Safe_ports port 563    # SNEWS
acl Safe_ports port 591    # Filemaker
acl SSL_ports port 1688    # KMS
acl Safe_ports port 488    # GSS-HTTP
acl SSL_ports port 5222    # Jabber
acl Safe_ports port 70    # GOPHER
acl SSL_ports port 8080    # Alterator
acl Safe_ports port 210    # WAIS
acl SSL_ports port 21    # FTP
acl Safe_ports port 873    # RSYNC
acl SSL_ports port 563    # SNEWS (C)
acl SSL_ports port 443    # HTTPS (C)
http_access allow manager to_localhost
http_access deny manager
http_access deny !Safe_ports
acl CONNECT method CONNECT
http_access deny CONNECT !SSL_ports
acl our_networks src 10.0.0.0/16    #
http_access deny !our_networks
http_access allow all
http_access deny all
http_port 10.0.0.254:3128
http_port 127.0.0.1:3128
hierarchy_stoplist cgi-bin ?
cache_dir ufs /var/spool/squid3 5000 16 256
maximum_object_size 65536 KB
tcp_outgoing_address 0.0.0.0
debug_options ALL,2
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     4320
retry_on_error on
coredump_dir /var/spool/squid3
udp_outgoing_address 0.0.0.0

на job.ru заходит без проблем...
Spoiler
718 10.0.0.20 TCP_MISS/304 275 GET http://kamenev.kz/wp-admin/admin-ajax.php? - DIRECT/195.210.46.21 -
1331717269.071 856 10.0.0.20 TCP_MISS/304 275 GET http://kamenev.kz/wp-admin/admin-ajax.php? - DIRECT/195.210.46.21 -
1331717271.271 223 10.0.0.20 TCP_MISS/200 584 GET http://clients1.google.com/complete/search? - DIRECT/173.194.69.100 text/javascript
1331717272.448 60 10.0.0.20 TCP_MISS/302 542 GET http://job.ru/ - DIRECT/89.249.20.165 text/html
1331717272.516 62 10.0.0.20 TCP_MISS/302 723 GET http://www.job.ru/ - DIRECT/89.249.20.165 text/html
1331717272.654 201 10.0.0.20 TCP_MISS/200 867 GET http://sitecheck2.opera.com/? - DIRECT/91.203.99.45 text/xml
1331717272.680 286 10.0.0.20 TCP_MISS/200 827 GET http://sitecheck2.opera.com/? - DIRECT/91.203.99.45 text/xml
1331717272.695 169 10.0.0.20 TCP_MISS/200 20845 GET http://krasnodar.job.ru/default.aspx - DIRECT/89.249.20.165 text/html
1331717272.737 211 10.0.0.20 TCP_MISS/200 874 GET http://sitecheck2.opera.com/? - DIRECT/91.203.99.45 text/xml
1331717272.836 30 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/library/css/seeker.css? - DIRECT/89.249.20.165 -
1331717272.864 57 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/library/css/page.css? - DIRECT/89.249.20.165 -
1331717272.866 59 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/library/plugins/te...TextboxList.css? - DIRECT/89.249.20.165 -
1331717272.869 61 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/_inc/FacebookPopups.js? - DIRECT/89.249.20.165 -
1331717272.871 63 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/seeker/_inc/LoginFacebook.js? - DIRECT/89.249.20.165 -
1331717272.873 65 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/_inc/career/poll/PollBlock.js? - DIRECT/89.249.20.165 -
1331717272.875 67 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/_inc/Cookies.js? - DIRECT/89.249.20.165 -
1331717272.877 60 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/library/js/common.js? - DIRECT/89.249.20.165 -
1331717272.879 56 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/library/js/jquery.js? - DIRECT/89.249.20.165 -
1331717272.881 57 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/library/js/Popup.js? - DIRECT/89.249.20.165 -
1331717272.883 59 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/seeker/_inc/JobSearchFilter.js? - DIRECT/89.249.20.165 -
1331717272.885 61 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/library/js/jquery-ui.js? - DIRECT/89.249.20.165 -
1331717272.887 63 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/_inc/Multiselect.js? - DIRECT/89.249.20.165 -
1331717272.889 65 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/_inc/WorkFieldSelectorNew.js? - DIRECT/89.249.20.165 -
1331717272.891 66 10.0.0.20 TCP_MISS/304 399 GET http://krasnodar.job.ru/seeker/_inc/Login.js? - DIRECT/89.249.20.165 -
1331717273.317 61 10.0.0.20 TCP_IMS_HIT/304 305 GET http://krasnodar.job.ru/library/image/flags/15x10/ru3.gif - NONE/- image/gif
1331717273.347 102 10.0.0.20 TCP_MISS/200 631 GET http://counter.rambler.ru/top100.cnt? - DIRECT/81.19.88.96 image/gif
1331717273.348 95 10.0.0.20 TCP_MISS/200 543 GET http://www.tns-counter.ru/V13a***R%3E*irr_...other/250657173 - DIRECT/217.73.200.222 image/gif
1331717273.370 117 10.0.0.20 TCP_MISS/200 414 GET http://counter.yadro.ru/hit;jobru? - DIRECT/88.212.196.104 image/gif
1331717273.412 94 10.0.0.20 TCP_MISS/200 395 GET http://bw.pronto.ru/brick/6/232/154/32/270...p;rnd=925115952 - DIRECT/213.152.143.31 text/javascript
1331717273.413 95 10.0.0.20 TCP_MISS/200 395 GET http://bw.pronto.ru/brick/6/232/154/32/35//&rnd=68027959 - DIRECT/213.152.143.31 text/javascript
1331717273.433 116 10.0.0.20 TCP_MISS/200 2595 GET http://bw.pronto.ru/brickgrid/6/232/154/32...p;rnd=315847658 - DIRECT/213.152.143.31 text/javascript
1331717273.457 139 10.0.0.20 TCP_MISS/200 5615 GET http://bw.pronto.ru/brickgrid/6/232/154/32...p;rnd=701394005 - DIRECT/213.152.143.31 text/javascript
1331717273.487 60 10.0.0.20 TCP_MISS/200 646 GET http://counter.yadro.ru/logo;jobru? - DIRECT/88.212.196.105 image/gif
1331717273.489 62 10.0.0.20 TCP_MISS/200 395 GET http://bw.pronto.ru/brick/6/232/154/32/21/...p;rnd=724975281 - DIRECT/213.152.143.31 text/javascript
1331717273.500 101 10.0.0.20 TCP_MISS/200 5618 GET http://bw.pronto.ru/brickgrid/6/232/154/32...p;rnd=625351878 - DIRECT/213.152.143.31 text/javascript
1331717273.531 118 10.0.0.20 TCP_MISS/200 9622 GET http://bw.pronto.ru/brickgrid/6/232/154/32...p;rnd=294386564 - DIRECT/213.152.143.31 text/javascript
1331717273.663 9 10.0.0.20 TCP_IMS_HIT/304 305 GET http://krasnodar.job.ru/library/image/main/ico-set.png - NONE/- image/png
1331717273.703 39 10.0.0.20 TCP_IMS_HIT/304 305 GET http://krasnodar.job.ru/library/image/back...face_seeker.png - NONE/- image/png
1331717273.703 39 10.0.0.20 TCP_IMS_HIT/304 305 GET http://krasnodar.job.ru/library/image/background/bgBtn.png - NONE/- image/png
1331717273.703 39 10.0.0.20 TCP_IMS_HIT/304 305 GET http://krasnodar.job.ru/library/image/back...nd/bgDotted.gif - NONE/- image/gif
1331717273.703 39 10.0.0.20 TCP_IMS_HIT/304 305 GET http://krasnodar.job.ru/library/image/back...nd/li_small.gif - NONE/- image/gif
1331717273.703 39 10.0.0.20 TCP_IMS_HIT/304 305 GET http://krasnodar.job.ru/library/image/background/bgBtn.png - NONE/- image/png
1331717273.703 39 10.0.0.20 TCP_IMS_HIT/304 305 GET http://krasnodar.job.ru/library/image/back...nd/bgDotted.gif - NONE/- image/gif
1331717273.703 39 10.0.0.20 TCP_IMS_HIT/304 305 GET http://krasnodar.job.ru/library/image/back...nd/li_small.gif - NONE/- image/gif
1331717273.751 9 10.0.0.20 TCP_HIT/200 1704 GET http://bw.pronto.ru/img/91/30/24/1.png - NONE/- image/png
1331717273.792 41 10.0.0.20 TCP_IMS_HIT/304 305 GET http://www.job.ru/library/image/background..._banners_bg.png - NONE/- image/png
1331717273.792 88 10.0.0.20 TCP_MISS/200 1297 GET http://krasnodar.job.ru/ajax.ashx? - DIRECT/89.249.20.165 text/html
1331717273.792 557 10.0.0.20 TCP_MISS/200 546 GET http://www.google-analytics.com/__utm.gif? - DIRECT/173.194.69.139 image/gif
1331717273.792 557 10.0.0.20 TCP_MISS/200 546 GET http://www.google-analytics.com/__utm.gif? - DIRECT/173.194.69.139 image/gif
1331717273.903 0 10.0.0.20 TCP_IMS_HIT/304 305 GET http://krasnodar.job.ru/library/image/background/blank.gif - NONE/- image/gif

на втором прокси squid 3.1.6 с конфигом:

Код: Выделить всё

gw ~ # cat /etc/squid3/squid.conf_proxy
acl manager proto cache_object
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443    # HTTPS
acl Safe_ports port 80    # HTTP
acl Safe_ports port 901    # SWAT
acl Safe_ports port 631    # CUPS
acl Safe_ports port 563    # SNEWS
acl Safe_ports port 591    # Filemaker
acl SSL_ports port 1688    # KMS
acl Safe_ports port 488    # GSS-HTTP
acl SSL_ports port 5222    # Jabber
acl Safe_ports port 70    # GOPHER
acl SSL_ports port 8080    # Alterator
acl Safe_ports port 210    # WAIS
acl SSL_ports port 21    # FTP
acl Safe_ports port 873    # RSYNC
acl SSL_ports port 563    # SNEWS (C)
acl SSL_ports port 443    # HTTPS (C)
http_access allow manager to_localhost
http_access deny manager
http_access deny !Safe_ports
acl CONNECT method CONNECT
http_access deny CONNECT !SSL_ports
acl our_networks src 10.0.0.0/16    #
http_access deny !our_networks
http_access allow all
http_access deny all
http_port 10.0.0.10:3129
http_port 127.0.0.1:3129
hierarchy_stoplist cgi-bin ?
cache_dir ufs /var/spool/squid3 5000 16 256
maximum_object_size 65536 KB
tcp_outgoing_address 0.0.0.0
debug_options ALL,2
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     4320
retry_on_error on
coredump_dir /var/spool/squid3
udp_outgoing_address 0.0.0.0

не работает :frusty:
Спасибо сказали:
Аватара пользователя
McSim
Сообщения: 419
Статус: Экспериментатор
ОС: заGNU/Linux Debian

Re: как сделать cache.log в squid более человекопонятным?

Сообщение McSim »

аааааааа .... мазафака....
пойду застрелю провайдера на неработающем прокси и job.ru
:gun2:
Спасибо сказали: