All Apps and Add-ons

Problem in running a command in splunk hosted in docker

virtuosoo
Explorer

Hello ,

I am trying to run an instance of splunk on docker-composite.
Everything seems working , But I need to run splunk command to add a user, I don't know how to do it via docker-composer.

  • So my problem is "How to configure docker-compose to
    run "?

    splunk add user test -role Admin -password testpassword -full-name "TEST"

  • My Config docker-compose :

version: "2"

services:
splunk:
#build: .
hostname: splunk
image: splunk/splunk:7.2
environment:
SPLUNK_START_ARGS: --accept-license --answer-yes
SPLUNK_ENABLE_LISTEN: 9997
SPLUNK_ADD: tcp 1514
SPLUNK_PASSWORD: "test12345"
volumes:
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ports:
- "8000:8000"
- "9997:9997"
- "8088:8088"
- "1514:1514"

THANK YOU IN ADVANCE !!!

0 Karma

codebuilder
SplunkTrust
SplunkTrust

All you need to do is connect to the console:

docker exec -it <image_id> /bin/bash

Alternatively, you can pass in the full command you want to run with the same syntax:

docker exec -it <image_id> /opt/splunk/bin/splunk <your_command_here>
----
An upvote would be appreciated and Accept Solution if it helps!
0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud | Unified Identity - Now Available for Existing Splunk ...

Raise your hand if you’ve already forgotten your username or password when logging into an account. (We can’t ...

Index This | How many sides does a circle have?

February 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

Registration for Splunk University is Now Open!

Are you ready for an adventure in learning?   Brace yourselves because Splunk University is back, and it's ...