Você pode usar uma combinação de SetEnvIf
e env=
na definição de log.
O manual do Apache cobre-o em "log condicional", citando aqui.
Conditional Logs
There are times when it is convenient to exclude certain entries from the access logs based on characteristics of the client request. This is easily accomplished with the help of environment variables. First, an environment variable must be set to indicate that the request meets certain conditions. This is usually accomplished with
SetEnvIf
. Then theenv=
clause of theCustomLog
directive is used to include or exclude requests where the environment variable is set. Some examples:
# Mark requests from the loop-back interface
SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
# Mark requests for the robots.txt file
SetEnvIf Request_URI "^/robots\.txt$" dontlog
# Log what remains
CustomLog logs/access_log common env=!dontlog
É abordado em esta seção do manual.
Você estaria procurando algo como (não testado)
SetEnvIf Remote_Addr "157\.98\.65\.xxx" dontlog
ou
SetEnvIf User-Agent "collectd/4\.10\.9" dontlog