> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.13/learn-about-cortex-xsoar/customize-and-configure-cortex-xsoar/logs/send-the-audit-trail-to-an-external-log-service.md).

# Send the Audit Trail to an External Log Service

Organizations that are required to implement centralized logging for compliance and monitor requirements benefit from the syslog export.

{% hint style="info" %}

### Note

By default, audit logs are retained for 365 days on the server. If you are sending logs to an external syslog, you may want to limit the retention on the server to a shorter period of time, such as 90 days., using the `demisto.audits.purge.retention` server configuration. For more information, see [Audit Trail](/xsoar-6-administrator-guide/6.13/learn-about-cortex-xsoar/customize-and-configure-cortex-xsoar/logs/audit-trail.md).
{% endhint %}

To send the Cortex XSOAR audit trail to an external log service, you create several custom server configurations.

1. Select Settings → About → Troubleshooting → **Add Server Configuration**.
2. Add the following required keys and values:

   | Key                   | Value                                                                                                                                                                                                                                              | Required                                              |
   | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
   | **`syslog.enabled`**  | **`true`**                                                                                                                                                                                                                                         | Required                                              |
   | **`syslog.protocol`** | <p><strong><code>tcp</code></strong></p><p><strong><code>udp</code></strong></p><p><strong><code>tcp+tls</code></strong></p><p><strong><code>unix</code></strong></p><p>Default: <strong><code>unix</code></strong> (for localhost syslogging)</p> | Required                                              |
   | **`syslog.host`**     | ***`<syslog server>`***                                                                                                                                                                                                                            | Required. This key is not required for UNIX protocol. |
   | **`syslog.port`**     | ***`<destination port>`***                                                                                                                                                                                                                         | Required. This key is not required for UNIX protocol. |
   | **`syslog.tag`**      | ***`<syslog tag>`*** Default is Demisto.                                                                                                                                                                                                           | Optional                                              |
   | **`syslog.format`**   | <p>RFC3164</p><p>RFC5424</p><p>Default is empty, which uses a custom format that is a combination of both formats.</p>                                                                                                                             | Optional                                              |
   | **`syslog.filter`**   | ***`<object/action>`***                                                                                                                                                                                                                            | Optional                                              |
   | **`syslog.priority`** | Default is a number for LOG\_INFO with LOG\_DAEMON. If you want to change the default, contact Cortex XSOAR Customer Support.                                                                                                                      | Optional                                              |
3. (Optional) To modify the facility level of syslogs, in the **`syslog.priority`** parameter, add the facility and severity levels and the resulting number in the following format:

   ***`<severity level>`*****`|`*****`<facility level>`*****`=`*****`<resulting number>`*****`.`**

   For example, to view **`informational`** messages for log level **`local7`** add the **`6|184=190`** value.

   Where as

   6 = severity level (**`informational`**)

   184 = facility level (**`local7`**), calculated by 23\*8

   190 = total of the severity and facility levels

   For information about the syslog facility and severity levels, see [What are Syslog Facilities and Levels](https://success.trendmicro.com/solution/TP000086250-What-are-Syslog-Facilities-and-Levels)

**Example**

In this example, we want to match audit trail entries of **`login success`** and **`login failure`**. To accomplish this, we set the **`syslog.filter`** parameter to **`login/.*`**.

Sample Syslog

```screen
CEF:0|Palo Alto Networks|Palo Alto Networks Cortex XSOAR|3.6.0-master.27665.da330b76ddbdf9bbf8e1dab82978550f2b5446c8|login|failure|3|suser=john startTime=1521835930684963 cs1=john cs1Label=identifier cs2=Cookie: [hsfirstvisit\=http%3A%2F%2Flocalhost%3A7070%2F||1464113050169; _ga\=GA1.1.296351272.1461620234; __hstc\=181257784.72e717e61ded2087506747f5da786796.1464113050173.1464122836548.1469409642245.3; __hssrc\=1; hubspotutk\=72e717e61ded2087506747f5da786796; local-theme\=light; XSRF-TOKEN\=AgF4Peo0Gqa8zlIB31fLl9rHrbsLn2uri/zJ+cWVdfE06qS+e59V3iNhJ1uhCFsPQ+N+s7nIXmvz6coWudI0/XTPhC5q4nZeyZNmL+8/u4nQlWQEPNX2Go2RsbnY3J8b14Je4Ch8mMfVE2ES69TcLkE1Vq3/UaIQdkBV3v9IyCY\=]\n\nReferer: [http://localhost:8080/]\n\nAccept: [application/json]\n\nX-Xsrf-Token: [AgF4Peo0Gqa8zlIBk1GLl9rHrbsLn2uri/zJ+cWVdfE06qS+e59V3iNhJ1uhCFsPQ+N+s7nIXmvz6coWudI0/XTPhC5q4nZeyZNmL+8/u4nQlWQEPNX2Go2RsbnY3J8b14Je4Ch8mMfVE2ES69TcLkE1Vq3/UaIQdkBV3v9IyCY\=]\n\nContent-Length: [142]\n\nAccept-Language: [en-US,en;q\=0.9,he;q\=0.8,ms;q\=0.7]\n\nContent-Type: [application/json]\n\nhost/ip: [::1]:62296\nConnection: [keep-alive]\n\nUser-Agent: [Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36]\n\nApi_truncate_results: [true]\n\nOrigin: [http://localhost:8080]\n\nAccept-Encoding: [gzip, deflate, br]\n\nerror: Invalid credentials:Invalid username or password\nDnt: [1]\n cs2Label=details
 
CEF:0|Palo Alto Networks|Palo Alto Networks Cortex XSOAR|3.6.0-master.27665.da330b76ddbdf9bbf8e1dab82978550f2b5446c8|login|in|3|suser=john startTime=1521835934123052 cs1=john cs1Label=identifier cs2=host/ip: [::1]:62296\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36 cs2Label=details client: 127.0.0.1:57284
 
message: CEF:0|Palo Alto Networks|Palo Alto Networks Cortex XSOAR|3.6.0-master.27665.da330b76ddbdf9bbf8e1dab82978550f2b5446c8|login|out|3|suser=john startTime=1521835927224046 cs1=john cs1Label=identifier cs2=N/A cs2Label=details
```

**Audit Trail Format**

Cortex XSOAR audit trail details are formatted using Common Event Format (CEF) with custom CEF fields. The audit format is:

**`CEF:<CEFVersion>|<CEFVendor>|<CEFProduct>|<server version>|<audit category>|<action>|3|suser=<user> startTime=<audit log time> cs1=<id of item being audited> cs1Label=identifier cs2=<action info> cs2Label=details`**

For example, from the first log in the sample Syslog above:

**`<CEFVersion>`** = 0

**`<CEFVendor>`** = Palo Alto Networks

**`<CEFProduct>`** = Palo Alto Networks Cortex XSOAR

**`<audit category>`** = login (can be accounts, incidents, login, automation, and so on)

**`<action>`** = failure (can be delete, create, add and so on)

**`<action info>`** = 3 (can be any kind of additional info)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.13/learn-about-cortex-xsoar/customize-and-configure-cortex-xsoar/logs/send-the-audit-trail-to-an-external-log-service.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
