Forum Discussion

jkirankumar1993's avatar
jkirankumar1993
Icon for Nimbostratus rankNimbostratus
Feb 12, 2018

irule not executing.

Hi All, I have created a irule and added to virtual server. I am logging some details in the irule. When I go to statistics I see that total executions is 0. And I cant see anything in /var/log/ltm. I dont know why it is not running. This is my code. Someone please help me.

 

when HTTP_REQUEST {

log local0. "New code"
set referrer_host [ URI::host [HTTP::header value Referer]]
log local0. "host: [HTTP::host]"
log local0. "uri: [HTTP::uri]"
log local0. "path: [HTTP::path]"
log local0. "Referer: $referrer_host"


if { ([HTTP::header exists "Referer"]) } {   

   if { $referrer_host eq "" } {
           set referrer_host "none"
           }

  if { !($referrer_host contains "jiratest.corp.chartercom.com") } {

log local0. "referrer is not equal to jira"
    if { ([HTTP::uri] contains "/rest/") } {
log local0. "referrer is not equal to jira and contain rest"
      pool JIRA-test-external-pool
    } else {
    pool JIRA-test-pool
    }

  } else {
  log local0. "referer is jira"
  pool JIRA-test-pool
  }

log local0. "Something went wrong"
 pool JIRA-test-pool

} else {
log local0. "Referer does not exist"
pool JIRA-test-pool
 }


}

1 Reply

  • Look the ltm statistics for your virtual server and verify that you are actually hitting the correct virtual server, It may sounds stupid but it happens a lot.

     

    If the irule is attached to the virtual server you should se some activity in the ltm log.