如何从访问日志中删除负载均衡器污染

时间:2021-06-27 19:50:41

I have a pair of Sun web servers (iws6) sitting behind a load balancer. It likes to know if the web servers are up and continually asks for /alive.html. That is fine but how do I not log that in my access log?

我有一对Sun Web服务器(iws6)坐在负载均衡器后面。它喜欢知道Web服务器是否已启动并且不断要求/alive.html。这很好但我怎么不在我的访问日志中记录?

Failing that, how could I have the archiver strip out that accesses when it roles the file over?

如果做不到这一点,我怎么能让归档器在文件转移时剥离出访问权限?

I would prefer something more elegant that cron calling grep -v alive.html

我更喜欢cron调用grep -v alive.html的更优雅的东西

2 个解决方案

#1


2  

You can give Apache rules about what logs to suppress. Maybe IWS has something similar?

您可以为Apache提供有关要禁止的日志的规则。也许IWS有类似的东西?

http://httpd.apache.org/docs/1.3/logs.html#conditional

#2


1  

Logs are usually one line per entry so that you can grep for what you want. The idea is to have everything in the file, but to use grep in order to read the parts you care about. Grep for everything but load balancer stuff when you read them.

日志通常每个条目一行,以便您可以根据需要进行grep。我们的想法是在文件中包含所有内容,但要使用grep来读取您关心的部分。当你阅读它们时,grep除了负载均衡器之外的一切。

#1


2  

You can give Apache rules about what logs to suppress. Maybe IWS has something similar?

您可以为Apache提供有关要禁止的日志的规则。也许IWS有类似的东西?

http://httpd.apache.org/docs/1.3/logs.html#conditional

#2


1  

Logs are usually one line per entry so that you can grep for what you want. The idea is to have everything in the file, but to use grep in order to read the parts you care about. Grep for everything but load balancer stuff when you read them.

日志通常每个条目一行,以便您可以根据需要进行grep。我们的想法是在文件中包含所有内容,但要使用grep来读取您关心的部分。当你阅读它们时,grep除了负载均衡器之外的一切。