Forum Discussion
Arie
Altostratus
Jul 06, 2007Log number of times web page contains specific content?
We're running ColdFusion, which sends a specific string to the browser ("<.") when it's in the process of restarting. Since it takes the LTM a few seconds to catch this I have two questions:
...
Jul 09, 2007
1) How can we log the number of times this happens?
You can query the HTTP::payload in your HTTP_RESPONSE event and search for this string of characters. Then, simply by using the log command you can log a message to the system log. This won't keep a count for you, but it will give you a timestamp for each occurrence and from that you could build a rate calculation by pulling out all the entries.
If you just want a raw count (and you are above v9.2), you can use the Statistics Profile to store values from within iRules. See this tech tip on how to do it
http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=66
Click here
2) How can we select another node when this happens (other than utilizing a monitor)? My thinking is that if we examine the content and find this string (which is the sole content of a page when the restart occurs) we should be able to select another node instantaneously.
For this you'll have to search the HTTP::payload from the HTTP_RESPONSE event and if you find this condition, you can use LB::reselect along with the HTTP::retry command to retry the request to another backend resource. Here's a post that goes over the LB::reselect command:
http://devcentral.f5.com/default.aspx?tabid=53&view=topic&forumid=5&postid=5201
Click here
Hope this helps...
-Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
