Forum

How do you remote log entries of of ip?

John
5 December 2017, 09:04
Hello. I monitor my website every 60 seconds so I get messages like this in my system.log
127.0.0.1|Tue 05 Dec 2017 02:32:08 -0500|Silent client disconnected
Basically it fills it all up. what can i do to prevent these entries from going to system.log or in the log in general?
Hugo Leisink
5 December 2017, 14:26
Instead of just connecting and disconnecting, your monitoring tool could also behave like a proper HTTP client by sending a simple 'GET / HTTP/1.0'. This way, you can also test whether the server is actually working.

Another option is to set LogTimeouts to 'no'. This will also silent other timeout logs.
John
5 December 2017, 15:26
I think i could change to check via GET but instead of taking up system.log; it will take more log space in the accesslog. Is there a urltoolkit to not log access when ip matches? LogTimeouts to 'no' is better as the monitoring connections per minute is huge but I still want to cache the ips that is not mines.

I just want to trim the log size from my connections to test wheather hiawatha is up.
Hugo Leisink
5 December 2017, 15:27
You could make the check request files from a specific virtual host, for which you set the access logfile to /dev/null.
John
8 December 2017, 18:09
I am sorry about the title of this thread as it should be "remove" log entries.

Can you tell me if there is a rewrite rule that can remove entries for access to a file. example:

Match ^/isthesiteup.php$ OmitRequestLog

Currently it is not allowed in Match.
Thanks hugo.
Hugo Leisink
9 December 2017, 16:38
You could also add it manually in src/toolkit.c, line 262. Of course, recompile after changing the source. You can also use this instead:
UrlToolkit {
...
Match ^/isthesiteup.php$ Return
Do OmitRequestLog
}
John
9 December 2017, 17:00
I double check the manual again and OmitRequestLog is still listed under Match; does this mean it should be in newer updates or can you remove it from the reference?

Again I appreciate the suggestion to /dev/null the site checks to a virtual host. Would you say that is more efficient to do or would the omitrequestlog option be similar?

Thanks again!
John
10 December 2017, 05:24
It doesnt' seem like OmitRequestLog is working in the urltoolkit rule. It shows in the accesslog as a GET /isthesiteup.php
Hugo Leisink
10 December 2017, 12:17
I also checked the manual. OmitRequestLog is not listed under Match.

Sorry, forgot a small detail in the toolkit rule:
UrlToolkit {
...
Match !^/isthesiteup.php$ Return
Do OmitRequestLog
}
John
11 December 2017, 05:35
Hugo. you are a wizard.

Sorry for my ignorance. I might have wanted this IN the match section as I read the top portion which is obvious after your correction that it pertained to header.
Hugo Leisink
11 December 2017, 11:04
Hugo. you are a wizard.

Not a real one. But I play a 21st level wizard character during Dungeons & Dragons sessions with friends.
This topic has been closed.