Squid 로깅 설정
1. Squid에서 PLURA 로깅 연동 설정
logformat httpd %>a %[ui %[un [%tl] “%rm %ru HTTP/%rv” %>Hs %<st “%{Referer}>h” “%{User-Agent}>h” %Ss:%Sh
access_log /var/log/squid/access.log httpd2. PLURA 로깅을 JSON 형식으로 저장하는 방법
vi /etc/squid/squid.conf forwarded_for on
acl has-xff req_header X-Forwarded-For ^(([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)|(\[([0-9a-f]+)?:([0-9a-f:]+)?:([0-9a-f]+|0-9\.]+)?\]))
# add logging for PLURA
logformat combinedjson {“Remote-addr”: “%>a”, “X-forwarded-for”: “%{X-Forwarded-For}>h”, “Request-date”: “%tl”, “Method”: “%rm”, “Request”: “%rm %rp HTTP/%rv”, “Host”: “%>rd”, “Uri”: “%ru”, “Resp-Content-Type”: “%mt”, “Refere”: “%{Referer}>h”, “User-Agent”: “%{User-Agent}>h”, “Status”: “%>Hs”, “Resp-Content-Length”: “%<st”, “ProxyStatus”: “%Ss:%Sh”}
#access_log /var/log/squid/access.log combinedjson
access_log stdio:/var/log/plura/weblog.log combinedjson !has-xff
access_log stdio:/var/log/plura/weblog.log combinedjson has-xff3. Squid를 PLURA 웹 호스트로 인식시키기
4. Squid Access 로그 파일에 권한 부여

참고 사이트
참고사이트 XFF
Last updated