how to add logging to irule

Hi everyone

i want to add logging for my irule, thank you

log local0. “ALERT! - IP [IP::client_addr] is using [SSL::profile]”

when CLIENT_ACCEPTED {
  switch [IP::client_addr] {
    10.222.56.10 {
      SSL::profile Web-Staging-NoClientCert
    }
    default {
      SSL::profile Web-Staging-Client
    }
  }
}

Hi Mohanad,

SSL::profile does not return the profile name.

You can use this.

when CLIENT_ACCEPTED {
	switch [IP::client_addr] {
		10.222.56.10 {
			SSL::profile Web-Staging-NoClientCert
			log local0. "ALERT! - IP [IP::client_addr] is using Web-Staging-NoClientCert"
		}
		default {
			SSL::profile Web-Staging-Client
			log local0. "ALERT! - IP [IP::client_addr] is using Web-Staging-Client"
		}
	}
}

Hi,

Find here all about logging:

https://devcentral.f5.com/s/articles/the101-irules-101-logging-amp-comments

regards