Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions docs/EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Note that for more complex scenarios, we will opt to use a [Docker compose file]
* [Create search head cluster](#create-search-head-cluster)
* [Create indexer cluster and search head cluster](#create-indexer-cluster-and-search-head-cluster)
* [Enable root endpoint on SplunkWeb](#enable-root-endpoint-on-splunkweb)
* [Create sidecar forwarder](#create-sidecar-forwarder)
* [More](#more)

## Create standalone from CLI
Expand Down Expand Up @@ -808,5 +809,47 @@ $ SPLUNK_PASSWORD=<password> docker-compose up -d

Then, visit SplunkWeb on your browser with the root endpoint in the URL, such as `http://localhost:8000/splunkweb`.

## Create sidecar forwarder
<details><summary>k8s-sidecar.yml</summary><p>

```
apiVersion: v1
kind: Pod
metadata:
name: example
spec:
containers:
- name: splunk-uf
image: splunk/universalforwarder:latest
env:
- name: SPLUNK_START_ARGS
value: --accept-license
- name: SPLUNK_PASSWORD
value: helloworld
- name: SPLUNK_CMD
value: add monitor /var/log/
- name: SPLUNK_STANDALONE_URL
value: splunk.company.internal
volumeMounts:
- name: shared-data
mountPath: /var/log
- name: my-app
image: my-app
volumeMounts:
- name: shared-data
mountPath: /app/logs/
volumes:
- name: shared-data
emptyDir: {}
```
</p></details>

Execute the following to bring up your deployment:
```
$ kubectl apply -f k8s-sidecar.yml
```

After your pod is ready, the universal forwarder will be reading the logs generated by your app via the shared volume mount. In the ideal case, your app is generating the logs while the forwarder is reading them and streaming the output to a separate Splunk instance located at splunk.company.internal.

## More
There are a variety of Docker compose scenarios in the `docker-splunk` repo [here](https://github.com/splunk/docker-splunk/tree/develop/test_scenarios). Please feel free to use any of those for reference in terms of different topologies!