Forum Discussion
Angelo
Nimbostratus
Sep 13, 2012source address in URI header
Hi
i need to insert the source address into the header of a website is there a way for me to do this. i think i will need to have streaming for this but not sure how to set it up...
4 Replies
- Kevin_Stewart
Employee
Are you talking about the title or a block of HTML? It's relatively straight forward if there's an HTML object that you can (consistently) grab onto:
If the DOM object has a specific attribute just modify your stream expression to look for and replace that.when HTTP_REQUEST { disable stream processing for request traffic STREAM::disable s store the client IP address set client_ip [IP::client_addr] } when HTTP_RESPONSE { if { [HTTP::header Content-Type] equals "text/html" } { establish the stream expression - here we're just modifying the contents STREAM::expression "@@ - ($client_ip)@" enable stream processing STREAM::enable } } - Angelo
Nimbostratus
HI Kevin
thanks for the reply.. i need to insert the source address into the title. i'll try it... thanks for the reply - Kevin_Stewart
Employee
For some reason my code block was munged. Here's what I meant to say.
when HTTP_REQUEST {
disable stream processing for request traffic
STREAM::disable
s store the client IP address
set client_ip [IP::client_addr]
}
when HTTP_RESPONSE {
if { [HTTP::header Content-Type] equals "text/html" } {
establish the stream expression - here we're just modifying the contents <br /> STREAM::expression "@@ - ($client_ip)@"
enable stream processing
STREAM::enable
}
}
This replaces the end title tag with the client IP and end tag. - Kevin_Stewart
Employee
Ahh! it did it again...when HTTP_REQUEST { disable stream processing for request traffic STREAM::disable s store the client IP address set client_ip [IP::client_addr] } when HTTP_RESPONSE { if { [HTTP::header Content-Type] equals "text/html" } { establish the stream expression - here we're just modifying the contents STREAM::expression "@@ - ($client_ip)@" enable stream processing STREAM::enable } }
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