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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...