Forum Discussion

Arthur_7109's avatar
Arthur_7109
Icon for Nimbostratus rankNimbostratus
Jul 02, 2010

Can we send the ASM Support ID to the web application in a Request Header?

Hi there,

 

 

We have a customer with ASM and LTM, and they would like to send the ASM Support ID to the web servers in the pool as an additional HTTP Request Header, so that it can be logged there.

 

 

In the ASM irules event ASM_REQUEST_VIOLATION, the support ID is a field in ASM::violation_data, however we'd need that data in an event like HTTP_REQUEST_SEND or so.

 

 

We haven't found a way to do this, has anyone done something like this?

 

 

Thanks,

 

 

Arthur

3 Replies

  • I think you should be able to do the header insert in ASM_REQUEST_VIOLATION itself:

    
    when ASM_REQUEST_VIOLATION {
       HTTP::header insert "ASM-SUPPORT-ID [lindex [ASM::violation_data] 1]"
       log local0. "$log_prefix: Inserted header ASM-SUPPORT-ID: [lindex [ASM::violation_data] 1]"
    }
    

    Aaron
  • Yes that should work if a violation is triggered.

     

     

    We'd need the support ID in the good requests also, and there seems to be no event for those?
  • Then this looks like it would work regardless of whether the request triggered a violation:

    
    when HTTP_REQUEST_SEND {
       log local0. "\[ASM::violation_data\]: [ASM::violation_data]"
       clientside {
           Insert a header in requests with the ASM Support ID
          HTTP::header insert ASM-SUPPORT-ID [lindex [ASM::violation_data] 1]
          log local0. "ASM-SUPPORT-ID: [HTTP::header ASM-SUPPORT-ID]"
       }
    }
    

    Aaron