Skip to content

Commit

Permalink
chore: goaccess: ignore requests from md-ipl-(p-)mon
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Jan 16, 2024
1 parent c83cbe4 commit dd6e3f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/goaccess/import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ echo "importing Traefik access logs from $traefik_access_log_file into GoAccess"

# Note: With 0 matches, grep exits non-0 (which would break our while loop), so we run `true` in this case.
# Traefik logs requests on all of its entrypoints, including the internal "admin" one, which in turn receives health check requests. We only want requests to the entrypoint for public consumption "web".
# We ignore requests from 10.70.{171,172}.20 (md-ipl-mon/md-ipl-p-mon) completely, given that they are either for monitoring or load tasting purposes.
# Note: Passing the `-` argument to goaccess is important, otherwise it won't import data from stdin in non-TTY environments. https://github.com/allinurl/goaccess/issues/945
cat "$traefik_access_log_file" \
| (grep -E '"entryPointName":\s*"web"' || true) \
| (grep -v -E '"ClientHost":\s*"10.70.(171|172).20"' || true) \
| goaccess --config-file=/etc/goaccess.conf --no-global-config -o /srv/goaccess/report/index.html --restore --persist --tz="$tz" -

0 comments on commit dd6e3f9

Please sign in to comment.