4
0
Эх сурвалжийг харах

docs: add note about default log format for Squid proxy without user authentication in README.md

fix: ignore cache_object lines in parse_log_line function in log.py
Manuel 1 жил өмнө
parent
commit
7635edb38b
2 өөрчлөгдсөн 4 нэмэгдсэн , 0 устгасан
  1. 2 0
      README.md
  2. 2 0
      parsers/log.py

+ 2 - 0
README.md

@@ -130,6 +130,8 @@ _A modern tool for parsing and analyzing Squid logs, providing a sleek and user-
 apt install git python3 python3-pip python3-venv python3-pymysql libmariadb-dev curl
 apt install git python3 python3-pip python3-venv python3-pymysql libmariadb-dev curl
 ```
 ```
 
 
+> **Note:** If your Squid proxy **does not use user authentication** (i.e., you do not use login or password for clients), you can keep the **default log format** that comes with Squid. The detailed format below is only required for full compatibility with user-based reports.
+
 - ⚠️ !!Important ⚠️ For compatibility with user logs, use this format in /etc/squid/squid.conf:
 - ⚠️ !!Important ⚠️ For compatibility with user logs, use this format in /etc/squid/squid.conf:
 
 
 ```bash
 ```bash

+ 2 - 0
parsers/log.py

@@ -106,6 +106,8 @@ def get_file_inode(filepath):
 
 
 
 
 def parse_log_line(line):
 def parse_log_line(line):
+    if "cache_object://" in line:
+        return None
     if "|" in line:
     if "|" in line:
         return parse_log_line_pipe_format(line)
         return parse_log_line_pipe_format(line)
     parts = line.split()
     parts = line.split()