> For the complete documentation index, see [llms.txt](https://docs.strongdm.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.strongdm.com/admin/audit/logs/scenarios/export-to-splunk.md).

# Send Local Logs to Splunk

**Scenario:** you want to save gateway/relay logs to a Splunk Indexer. This guide presents a simple method to send all gateway/relay logs to a Splunk Indexer.

{% hint style="info" %}
As with all gateway/relay logs, the logs stored on the gateway/relay will not include Admin UI activities, which can be accessed via the `sdm audit activities` command.
{% endhint %}

### Setting up the export

1. Enable relay logging in the Admin UI under *Settings / Log Encryption & Storage*. Ensure logging is set to FILE.
2. Configure your indexer to receive the date from the forwarder:

   ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-7f45d1fb975ce7bab6c2f644d8963f2c4ade839e%2Flogs-splunk-1-configure1.png?alt=media\&token=056e0750-15f3-425d-973c-2e955eb64772) ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-da72d11156d1ee01dee25b3c457fc7551909e33b%2Flogs-splunk-2-configure2.png?alt=media\&token=b935d90f-5f61-4caa-923e-5bd068d298f7) ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-47e2b3731e009749ce8ed68576a2e82bae9f6dba%2Flogs-splunk-3-configure3.png?alt=media\&token=28cc5a7b-781e-4736-847e-e7ecdaf54257)
3. Create an index for StrongDM, called "sdm\_index" in this example:

   ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-21533c53c88296f5b09d161fff0984189ce88a90%2Flogs-splunk-4-createindex1.png?alt=media\&token=1681d54b-0eab-4fd1-891d-8cca3eaaf8f7) ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-6ae439422d9ca87e9656bc526223ef860d7a4cb0%2Flogs-splunk-5-createindex2.png?alt=media\&token=ef80453f-d890-4de4-ad8b-23ed45c08515) ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-e84fa664a1df788ddb70f777c67e99c0f13ae689%2Flogs-splunk-6-createindex3.png?alt=media\&token=ac397c30-c59d-4f1b-adbc-b4abed8703fc)
4. Install the forwarder, then configure the monitor.

   ```bash
   wget -O splunkforwarder-8.1.3-63079c59e632-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=8.1.3&product=universalforwarder&filename=splunkforwarder-8.1.3-63079c59e632-linux-2.6-x86_64.rpm&wget=true'
   sudo rpm -ihv splunkforwarder-8.1.3-63079c59e632-linux-2.6-x86_64.rpm
   export PATH=$PATH:/opt/splunkforwarder/bin
   splunk start
   ```

{% hint style="info" %}
You'll be asked to set the admin password on the first run of `splunk start`.
{% endhint %}

```bash
splunk list forward-server
Active forwards:
    ec2-34-210-43-66.us-west-2.compute.amazonaws.com:9997
Configured but inactive forwards:
    None

splunk add monitor /home/ec2-user/.sdm/logs/ -index sdm_index -sourcetype sdm

splunk list monitor
[...]
/home/ec2-user/.sdm/logs
        /home/ec2-user/.sdm/logs/relay.1616439304.0.log
        /home/ec2-user/.sdm/logs/relay.1616439311.0.log
        /home/ec2-user/.sdm/logs/relay.1616595755.0.log
        /home/ec2-user/.sdm/logs/relay.1616604787.0.log
        /home/ec2-user/.sdm/logs/relay.1616652500.0.log
[...]   
```

5\. You can search for "sdm\_index" on the indexer's search.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.strongdm.com/admin/audit/logs/scenarios/export-to-splunk.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
