Forum Discussion
URL Logging, Hitcount, IP addresses
Dear Dev Team,
We are getting complains from Server guys about some specific URLs are getting hit by lot of IP addresses and they are seeing lot of hits to those URLs.
The URLs are as below.
www.test.com/test?123*
www.test.com/test?xyz
www.test.com/test?abc
Could you pls help me in creating an iRule to find the below paramaters so that I can run it for few minutes to gather the information?
1) Number of hit counts for each URL
2) What are the IP addresses hitting each URL
Thank you in advance!
7 Replies
- What_Lies_Bene1
Cirrostratus
I'd suggest you are very careful using this to log the IP addresses as you may find your log files grows very quickly and the HSM may run out of disk space - use with care. This rule requires a Statistics Profile call busyurls and counters called 123, xyz and abc.when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/test?123*" { log local0. "[IP::client_addr] connected to [HTTP::host][HTTP::uri]" STATS::incr busyurls 123 } "/test?xyz*" { log local0. "[IP::client_addr] connected to [HTTP::host][HTTP::uri]" STATS::incr busyurls xyz } "/test?abc*" { log local0. "[IP::client_addr] connected to [HTTP::host][HTTP::uri]" STATS::incr busyurls abc } } } - muzammil_88686
Nimbostratus
Thank you Steve for your response!
If I want to capture only hit counts, what could be the iRule.
BTW, even if it is only for hit counts still I need to create Statistics Profile. - What_Lies_Bene1
Cirrostratus
You're welcome. Then it would be something like this, removing the log statements. Yes, you'd still need the Statistics Profile;when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/test?123*" { STATS::incr busyurls 123 } "/test?xyz*" { STATS::incr busyurls xyz } "/test?abc*" { STATS::incr busyurls abc } } } - Chamara_Fernan1
Nimbostratus
Good day,
is there any global setting is the F5 to send all the HTTP and HTTPS hit logs to syslog ?
Thank you
- MSZ_221163
Nimbostratus
Create a logging profile with all request then it will send the logs to the defined log server.
Security --> Even Logs --> Logging Profile Add
- Chamara_Fernan1
Nimbostratus
Thank you maz for the quick responce
- MSZ_221163
Nimbostratus
Please accept the answer :)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com