Forum Discussion

Thiyagu_343098's avatar
Thiyagu_343098
Icon for Nimbostratus rankNimbostratus
Oct 22, 2018

Irule to extract the host name and it in a file

Hello All, I'm looking for an IRULE to extract host name from the URL of client request to load balancer and log it in a file.

 

Could you please help me on this request?

 

Regards, Thiyagu

 

2 Replies

  • You can create log messages that are logged to /var/log/ltm

    when HTTP_REQUEST {
        log local. "HTTP request received from Host: [HTTP::host]"
    }
    

    Logging to other files/locations could be a risk as it may not be included in a log rotation therefore could potential fill your disk up quite quickly.

  • Hi,

    you can do it with

    when HTTP_REQUEST {
        log local0. "Request from : [IP::remote_addr] / Host requested [HTTP::host]"
    }