Forum Discussion

mcorvalan_57694's avatar
mcorvalan_57694
Icon for Nimbostratus rankNimbostratus
Aug 29, 2011

How to log HTTP_REQUEST

Hi All.

 

I send this post to ask you how can I make the Irule to log when I receive HTTP_REQUEST the name of vs.

 

for example I could find this

 

when HTTP_REQUEST {

 

log local0. "Client Address:[IP::client_addr], Request Type:[HTTP::method], Request URI:[HTTP::uri]"

 

}

 

This is very useful but I need to know this data comes from the some vs. for example the log shows me from which vs is coming this request.

 

Since now thanks alot.

 

  • [root@orchid:Active] config b virtual bar list

     

    virtual bar {

     

    snat automap

     

    pool foo

     

    destination 172.28.17.88:http

     

    ip protocol tcp

     

    rules myrule

     

    profiles

     

    http

     

    tcp

     

    }

     

    [root@orchid:Active] config b rule myrule list

     

    rule myrule {

     

    when HTTP_REQUEST {

     

    log local0. "Virtual: [virtual name], Client Address:[IP::client_addr], Request Type:[HTTP::method], Request URI:[HTTP::uri]"

     

    }

     

    }

     

    [root@orchid:Active] config tail /var/log/ltm

     

    Aug 29 22:33:28 tmm tmm[11782]: Rule myrule : Virtual: bar, Client Address:172.28.17.80, Request Type:HEAD, Request URI:/

     

  • kaefuh's avatar
    kaefuh
    Icon for Nimbostratus rankNimbostratus
    when HTTP_REQUEST {

     

     

    set app_pool [class match -value [HTTP::host] contains hostpool]

     

    if { not ($app_pool eq "") }{

     

    pool $app_pool

     

    log "[HTTP::host] pool to $app_pool"

     

    } else {

     

    use pool WabAppSCAN

     

    log local0.info "Virtual: [virtual name]:[HTTP::host] + client address [IP::client_addr] pools nodes is [LB::server]"

     

    }

     

    }