ADC

Export audit logs to HEC endpoints

Audit logs enable you to log the NetScaler states and status information collected by various modules in NetScaler. By reviewing the logs, you can troubleshoot problems or errors and fix them. You can export audit logs and events from NetScaler to HTTP Event Collector (HEC) endpoints.

For information related to export of audit logs and events to Splunk, see Export audit logs and events directly from NetScaler to Splunk.

Configure export of audit logs from NetScaler to HEC endpoint

  1. Create a schema file by running the Python script auditlog_schema_generator_for_hec_export.py from shell. Follow the instructions shown on the prompt.

    The support for creating a schema file is available from NetScaler release 14.1 build 60.x onwards. This schema file helps you configure the required fields and desired keys in the audit logs exported in JSON format for the HEC endpoint.

    python /var/analytics_conf/auditlog_schema_generator_for_hec_export.py​
    <!--NeedCopy-->
    
  2. Create a syslog action for the HEC endpoint.

    add audit syslogAction <action_name> <server-ip> -serverPort <server_port> -transport HTTP -loglevel <loglevel> -httpauthToken "<auth-token>" -httpendpointUrl "<endpoint-url>  -httpSchemaFile <schema-file-name>"
    <!--NeedCopy-->
    

    Example:

    add audit syslogAction sys_act 10.106.194.128 -serverPort 80 -logLevel ALL -transport HTTP -httpAuthToken "yPddOJH2WQiazU9lhsJSXrpyJvUWmBtZ"  -httpEndpointUrl "/ctxlogserver/UploadCitrixLogStream" -httpSchemaFile aot.json
    <!--NeedCopy-->
    

    In this configuration:

    • server-ip: The IP address of the HEC endpoint.
    • server-port: The port on which HEC is run (default 8088).
    • transport: Set as HTTP the transport for the HEC endpoint.
    • httpauthToken: Specify the authentication token to be included in the authorization header while sending logs to the HEC endpoint. This token is the authentication token created on the HEC endpoint while configuring the HTTP event collector.
    • httpendpointUrl: Specify the URL to which you have configured the HEC endpoint to get requests to. For example, “/services/collector/event”.
    • httpSchemaFile - The schema file created by running the Python script in Step 1.
  3. Add and bind a syslog policy.

    add audit syslogPolicy <name> <rule> <action>
    bind audit syslogGlobal <policyName> [-globalBindType <globalBindType>]
    <!--NeedCopy-->
    

    Example:

    add audit syslogPolicy http_sys_pol1 true http_sys_act1
    bind audit syslogGlobal -policyName http_sys_pol1 -priority 11
    <!--NeedCopy-->
    

After successful configuration, audit logs are sent as HTTP payloads to the HEC endpoint and are visible in the endpoint UI.

Export audit logs to HEC endpoints