Forum Discussion
jashicks_40657
Jul 01, 2011Nimbostratus
Maintain persistance based on unique user-agent header
Scenario I have many unique devices that identify themselves with a unique user-agent header. (each device has a different id that is provided in the user-agent header)
They submit multiple http requests in about a 5 minute window of time The source IP of the device could change during the window I need to maintain persistence based on that unique id we place in the user-agent header.
However each device has a different otherwise the example below would work for me.
when HTTP_REQUEST { if { [HTTP::header exists "X-Nokia-MSISDN"] } { if { [HTTP::header "X-Nokia-MSISDN"] != "" } { persist uie [HTTP::header "X-Nokia-MSISDN"] } else { persist source_addr } } else { persist source_addr } }
- Colin_Walker_12Historic F5 AccountI guess I'm missing the reason that you can't simply persist based on the header info. If there is a custom header that is unique to each device, and you want to persist based on the value of that header, regardless of IP address, then you're definitely on the right track:
when HTTP_REQUEST { if {[HTTP::header exists "X-Nokia-MSISDN"]} { persist [HTTP::header "X-Nokia-MSISDN"] } }
- hoolioCirrostratusOr maybe check if it has a value?
when HTTP_REQUEST { Add a UIE persistence record with a timeout of one hour if the header present and isn't empty if {[HTTP::header "X-Nokia-MSISDN"] ne ""} { persist uie [HTTP::header "X-Nokia-MSISDN"] 3600 } }
- Colin_Walker_12Historic F5 AccountSure, or check for a value, either way.
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