Forum Discussion

Snl's avatar
Snl
Icon for Cirrostratus rankCirrostratus
Apr 16, 2017

Irule for combine useragent & xforwarder-for

Hello Folks

 

I am looking for 2 combination irule for get user agent and X-forwarder-for (origin client ip)to send to server for audit purpose

 

any help appreciated

 

Thanks

 

2 Replies

  • I guess, Not possible to pass both values through iRule in Server but you can try other option in application.

     

    1) Client IP(X-forward) through F5

     

    2) Add Java/PHP script to grep client user agent

     

  • I'm not sure I follow.

    The F5 passes the User-Agent from the client to the server untouched. The X-Forwarded-For header can be added with a HTTP profile with the X-Forwarded-For option enabled. The server will then receive both items. No iRule is needed.

    If you need an iRule to combine both then this will do the job for you.

    when HTTP_REQUEST {
      HTTP::header insert "X-Audit-Info" "[IP::client_addr]:[HTTP::header User-Agent]"
    }