---
title: "splunk-s2s: Send data to Splunk indexers"
url: "https://axoflow.com/docs/axosyslog-core/chapter-destinations/splunk-s2s/"
description: "Send data to Splunk indexers over the Splunk-to-Splunk (S2S) protocol, the protocol of Splunk forwarders, using the network() destination."
last_modified: "2026-11-26T12:17:47+01:00"
---

> For the complete documentation index, see [llms.txt](https://axoflow.com/docs/axosyslog-core/llms.txt).

# splunk-s2s: Send data to Splunk indexers

Send data to Splunk indexers over the Splunk-to-Splunk (S2S) protocol, the protocol of Splunk forwarders, using the network() destination.

The `splunk-s2s` transport of the [`network()` destination](https://axoflow.com/docs/axosyslog-core/chapter-destinations/configuring-destinations-network/index.md)
sends data to Splunk indexers over the Splunk-to-Splunk (S2S) protocol, the same way as a Splunk forwarder does. You can use it to replace a Splunk forwarder, without reconfiguring the receiving port of your indexers.

To send data to Splunk over HTTP, use the [`splunk-hec-event()` destination](https://axoflow.com/docs/axosyslog-core/chapter-destinations/syslog-ng-with-splunk/index.md)
instead. To receive data from Splunk forwarders, see [splunk-s2s: Receive data from Splunk forwarders](https://axoflow.com/docs/axosyslog-core/chapter-sources/splunk-s2s/index.md).

## Prerequisites

- AxoSyslog version 4.30 or later.
- This feature requires a separate module. Install the `axosyslog-mod-splunk-s2s` package on [Debian/Ubuntu](https://axoflow.com/docs/axosyslog-core/install/debian-ubuntu/index.md)
  , or the `axosyslog-splunk-s2s` package on [RHEL and compatible distributions](https://axoflow.com/docs/axosyslog-core/install/rhel-fedora-almalinux/index.md)
  . If the module isn’t installed, AxoSyslog fails to start with an [`unexpected LL_IDENTIFIER` error](https://axoflow.com/docs/axosyslog-core/chapter-troubleshooting-syslog-ng/unexpected-ll-identifier/index.md)
  .
- A Splunk indexer that receives data on a port, usually port 9997. For details, see [Enable a receiver](https://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Enableareceiver)
  in the Splunk documentation.

## Example: Sending data to a Splunk indexer

The following destination sends the messages to a Splunk indexer. The rewrite rule sets the Splunk index and sourcetype of the events:

```shell
destination d_splunk_indexer {
  network(
    "splunk-indexer.example.com"
    port(9997)
    transport("splunk-s2s")
    template("$MSG")
  );
};

rewrite r_splunk_metadata {
  set("network" value(".splunk.index"));
  set("syslog" value(".splunk.sourcetype"));
};

log {
  source(s_network);
  rewrite(r_splunk_metadata);
  destination(d_splunk_indexer);
};
```

Use the `template()` option to set the raw event that the indexer receives. The default template of the `network()` destination adds a syslog header to the message.

## How splunk-s2s sends the events

AxoSyslog sends every log message as a separate event. The raw event is the message formatted with the `template()` of the destination. The timestamp of the event is the timestamp of the message.

AxoSyslog takes the metadata of the event from the following name-value pairs:

| Splunk metadata | Name-value pair | Default if not set |
| --- | --- | --- |
| `index` | `${.splunk.index}` | `main` |
| `source` | `${.splunk.source}` | `axosyslog` |
| `sourcetype` | `${.splunk.sourcetype}` | `axosyslog` |
| `host` | `${.splunk.host}` | The `${HOST}` macro, or the hostname of the AxoSyslog host if `${HOST}` is empty |

The [`splunk-s2s` source](https://axoflow.com/docs/axosyslog-core/chapter-sources/splunk-s2s/index.md)
sets the same name-value pairs, so events that AxoSyslog receives from a Splunk forwarder keep their metadata.

### Acknowledgements

AxoSyslog requests indexer acknowledgement. It considers an event delivered only when the indexer acknowledges it. If the connection breaks, AxoSyslog resends the events that the indexer hasn’t acknowledged yet. To keep these events if AxoSyslog restarts, use a [disk-buffer](https://axoflow.com/docs/axosyslog-core/chapter-routing-filters/concepts-diskbuffer/index.md)
.

## Options of the splunk-s2s transport

The `splunk-s2s` transport doesn’t have options of its own. The [options of the `network()` destination](https://axoflow.com/docs/axosyslog-core/chapter-destinations/configuring-destinations-network/reference-destination-network-chapter/index.md)
apply, for example:

- `port()`: The default port of the `splunk-s2s` transport is 9997.
- `template()`: The raw event. Use `template("$MSG")` to send only the message part.
- `tls()`: To send the data over TLS, configure TLS on the receiving port of the indexer as well. AxoSyslog starts the TLS handshake with the first byte of the connection.

Last modified November 26, 2026: [Document the splunk-s2s transport of network() (c8e827d7)](https://github.com/axoflow/axosyslog-core-docs/commit/c8e827d710eb3f59d046c3286f1ac7fe493ff58f)
