W
W
webviktor2018-06-23 13:56:50
linux
webviktor, 2018-06-23 13:56:50

How to exclude bots from logs?

Can you please tell me how to exclude requests from ALL bots from the logs?
Everywhere they write about construction like:
map $http_user_agent $exbot_ua {
~Pingdom 0;
~Googlebot 0;
~Baiduspider 0;
~YandexBot 0;
~YandexImages 0;
~AhrefsBot 0;
default 1;
}
If the bot is called EKLMN - I agree, you need to add it manually, but how to send off all *bot* *spider* ?
It's stupid to name them all.
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2018-06-23
@ky0

Implementing this inside the nginx config is not the best option, IMHO. It’s easier to post-factum logs and add up the exhaust without bots.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question