Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

I am adding a custom http header but how to print it out using irules?

David_M
Cirrostratus
Cirrostratus

Here's what I have done using curl -

The curl request is seen with "-v" it shows that the devicetyp header is being added to the request, but how do i fetch it from irules?

dvCJJEm


I can see the header if i use this irule with a loop:

when HTTP_REQUEST { 
foreach aHeader [HTTP::header names] { 
log local0. "HTTP Request Headers: $aHeader: [HTTP::header value $aHeader]" 
} }

wTD53tD

 

I want to grab this header value and store in a customer apm variable like session.custom.device.type.. i understand there are other ways to do this but we have chosen this for now.. any ideas??

1 ACCEPTED SOLUTION

that didnt work but this did

when ACCESS_SESSION_STARTED {
ACCESS::session data set session.custom.devicetype [HTTP::header value devicetyp]
}

 

View solution in original post

2 REPLIES 2

Hello David_M.

You should get the header value with this command:

[HTTP::header value "devicetyp"]

Also, you can set the APM session variable with:

ACCESS::session data set session.custom.device.type [HTTP::header value "devicetyp"]

 

Regards,
Dario.

that didnt work but this did

when ACCESS_SESSION_STARTED {
ACCESS::session data set session.custom.devicetype [HTTP::header value devicetyp]
}