Forum Discussion
RiverFish
Altostratus
Oct 04, 2012Newby needs irule help
Greetings. The software guys assigned this task to me, can anyone please help me come up with an irule?
"Please write an IRule or some kind of filter that inspects the last_login Cookie in the H...
nitass
Employee
Oct 04, 2012e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_RESPONSE {
if {[HTTP::cookie exists last_login]} {
foreach aheader [HTTP::header names] {
log local0. "[IP::client_addr]:[TCP::client_port] | ${aheader}: [HTTP::header value $aheader]"
}
}
}
}
on client
[root@centos251 ~] curl -I http://172.28.19.79
HTTP/1.1 200 OK
Date: Thu, 04 Oct 2012 17:16:06 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Fri, 11 Nov 2011 14:48:14 GMT
ETag: "4183e4-3e-9c564780"
Accept-Ranges: bytes
Content-Length: 62
Set-Cookie: last_login=tasmania path=/
Connection: close
Content-Type: text/html; charset=UTF-8
on bigip
[root@ve10:Active] config tail -f /var/log/ltm
Oct 5 00:59:48 local/tmm info tmm[4907]: Rule myrule : 172.28.19.251:49826 | Date: Thu, 04 Oct 2012 17:16:06 GMT
Oct 5 00:59:48 local/tmm info tmm[4907]: Rule myrule : 172.28.19.251:49826 | Server: Apache/2.2.3 (CentOS)
Oct 5 00:59:48 local/tmm info tmm[4907]: Rule myrule : 172.28.19.251:49826 | Last-Modified: Fri, 11 Nov 2011 14:48:14 GMT
Oct 5 00:59:48 local/tmm info tmm[4907]: Rule myrule : 172.28.19.251:49826 | ETag: "4183e4-3e-9c564780"
Oct 5 00:59:48 local/tmm info tmm[4907]: Rule myrule : 172.28.19.251:49826 | Accept-Ranges: bytes
Oct 5 00:59:48 local/tmm info tmm[4907]: Rule myrule : 172.28.19.251:49826 | Content-Length: 62
Oct 5 00:59:48 local/tmm info tmm[4907]: Rule myrule : 172.28.19.251:49826 | Set-Cookie: last_login=tasmania path=/
Oct 5 00:59:48 local/tmm info tmm[4907]: Rule myrule : 172.28.19.251:49826 | Connection: close
Oct 5 00:59:48 local/tmm info tmm[4907]: Rule myrule : 172.28.19.251:49826 | Content-Type: text/html; charset=UTF-8
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