Forum Discussion
Chris_Vanderlaa
Nimbostratus
Dec 15, 2015iRules - pull the 'url' from the http header and send to syslog server?
Hello,
I am trying to create an iRule that sends the following to syslog:
Read the HTTP header, take the 'URL' and send a message to syslog showing what URL was in the header CLIENT_ACCEP...
Kai_Wilke
MVP
Dec 15, 2015Hi Chris,
its not possible to access the URL during CLIENT_ACCEPTED event, since the client hasn't send this information at this stage.
Take a look to the customized rules below. I've added a unique connection ID for better filtering of syslog messages and logging of HOST and PATH values.
when CLIENT_ACCEPTED {
set request_stamp [clock clicks]
set client_ip [IP::client_addr]
set virtual_ip [IP::local_addr]
log 1.2.3.4 "ConID: $request_stamp : Client \"$client_ip\" has connected to VIP \"$virtual_ip\""
}
when HTTP_REQUEST {
set url "[HTTP::host][HTTP::path]"
log 1.2.3.4 "ConID: $request_stamp : New HTTP Request received for \"$url\""
}
when SERVER_CONNECTED {
set server_ip [IP::server_addr]
log 1.2.3.4 "ConID: $request_stamp : LTM has connected Client \"$client_ip\" to Server \"$server_ip\""
}
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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