Forum Discussion

jashicks_40657's avatar
Icon for Nimbostratus rankNimbostratus
Jul 01, 2011

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 } }

3 Replies

  • Colin_Walker_12's avatar
    Historic F5 Account
    I 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"]

    I guess I don't understand given your description why you don't want to do that. Could you provide a little more detail please? 🙂


  • Or 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