mirror of
https://github.com/SubleXBle/Fail2Ban-Report.git
synced 2026-02-06 00:38:33 -06:00
Update fail2ban_log2json.sh
added regex (^|[^A-Za-z]) to avoid using incorrect ban or unban events.
This commit is contained in:
@@ -13,7 +13,7 @@ mkdir -p "$OUTPUT_JSON_DIR"
|
||||
# === Processing ===
|
||||
echo "[" > "$OUTPUT_JSON_FILE"
|
||||
|
||||
grep -E "Ban |Unban " "$LOGFILE" | awk -v today="$TODAY" '
|
||||
grep -E "(^|[^A-Za-z])(Ban|Unban) " "$LOGFILE" | awk -v today="$TODAY" '
|
||||
{
|
||||
timestamp = $1 " " $2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user