Installation

CLI help

magnuscowie80
Explorer

Hi everyone, does anyone know a way of running splunk admin commands via a script. I need to run ./splunk reload deploy-server via cron job

Labels (1)

vikramyadav
Contributor

Hi @magnuscowie80 , you can automate Splunk deployment by using ansible. You can integrate ansible and Splunk that will be much efficient and easier than the script.

--------------------------------------------------------

If this helps your like will be appreciated😀



richgalloway
SplunkTrust
SplunkTrust

If you can type it on the command line then you should be able to put it in a script.  Just be sure to include credentials with commands that need them.

/opt/splunk/bin/splunk reload deploy-server -auth user:password
---
If this reply helps you, Karma would be appreciated.

isoutamo
SplunkTrust
SplunkTrust
The biggest issue would be, how to secure your credentials, so other cannot see those and use later on.
One way to do this is e.g. use ansible tower with callback on source node and then use ansible vault to store/crypt credentials. I suppose that there are some other ways too to do it.
r. Ismo
0 Karma

magnuscowie80
Explorer

That is the issue, securing my your credentials, I am guessing am going to be learning ansible.. thanks for the reply

0 Karma

isoutamo
SplunkTrust
SplunkTrust
Just look ansible attribute no_log and use ansible vault to secure your credentials and passwords on your repositories.
0 Karma
Get Updates on the Splunk Community!

Index This | When is October more than just the tenth month?

October 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What’s New & Next in Splunk SOAR

 Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us for an ...