Product Documentation

Configuring Policy Based Logging for Content Switching

Aug 22, 2013

You can configure policy based logging for a content switching policy. Policy based logging enables you to specify a format for log messages. The contents of the log message are defined by using a default syntax expression in the content switching policy. When the content switching action specified in the policy is performed, the NetScaler appliance constructs the log message from the expression and writes the message to the log file. Policy based logging is particularly useful if you want to test and troubleshoot a configuration in which content switching actions identify the target load balancing virtual server at run time.

Note: If multiple policies bound to a given virtual server evaluate to TRUE and are configured with an audit message action, the NetScaler appliance does not perform all the audit message actions. It performs only the audit message action that is configured for the policy whose content switching action is performed.

To configure policy based logging for a content switching policy, you must first configure an audit message action. For more information about configuring an audit message action, see Configuring Policy-Based Logging. After you configure the audit message action, you specify the action in a content switching policy.

To configure policy based logging for a content switching policy by using the command line interface

At the command line, type the following commands to configure policy based logging for a content switching policy and verify the configuration:

  • set cs policy <policyName> -logAction <string>
  • show cs policy <policyName>

Example

> set cs policy cspol1 -logAction csLogAction 
 Done 
> show cs policy cspol1 
 
	Policy: cspol1	Rule: TRUE	Action: csact1 	 
	LogAction: csLogAction 	  
	Hits: 0 
 
1)	CS Vserver: csvs1 
	Priority: 10 
 Done 
> 

To configure policy based logging for a content switching policy by using the configuration utility

Navigate to Traffic Management > Content Switching > Policies, open a policy and, in the Log Action list, select a log action for the policy.