I wish to create a script for setting up forwarding to a splunk server. Here's what I have so far:

./splunk add forward-server SPLUNK-IP-ADDRESS:SPLUNK-PORT

However, it asks for my credentials. How can I non-interactively pass credentials to splunk and setup the forwarder?

1 Answer 1


You can use the splunk login command to pass your credentials to the Splunk server:

./splunk login -auth 'admin:mypassword'
./splunk add forward-server SPLUNK-IP-ADDRESS:SPLUNK-PORT 
  • of course - doing this means the username and password are in your command history
    – warren
    Sep 10, 2020 at 16:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .