Reloading the auth system via CLI

Note: Tina pointed out that this does not apply to the authorize.conf file. This will be fixed in an upcoming version of splunk.

This comes up every once in a while on the support channel (EFnet/#splunk), so I guess that means I should do a blog post on it.

If you’re making changes to the authentication.conf file and want to reload Splunk’s auth system without going through the web UI, you can use one of our internal functions to do it at the command line:

$ splunk _internal rpc-auth ‘<call name=”syncAuth”><params/></call>’

This fires off the same call that the UI would use to reload the auth system, so it functions identically. Note that this is an authenticated call, so you’ll need to use one of the standard authentication methods (-auth, splunk login, or the SPLUNK_USERNAME/SPLUNK_PASSWORD env vars…).

10 Responses to “Reloading the auth system via CLI”

  1. alex@splunk Says:

    well done, this rocks!

  2. Joshua Rodman Says:

    workxs with -uri for remote reload hupping!

    prompt$ splunk _internal rpc-auth ‘’ -uri https://remotesplunk:8089 -auth admin

    (amrit had to spoonfeed this part, buuuhhh.)

  3. Chris Says:

    $ sudo ./splunk _internal rpc-auth ” -uri https://localhost:8089 -auth admin:changeme

    $

    What is the correct usage for this command?

    Thanks,

    Chris

  4. amrit Says:

    Chris, it looks like the example Josh pasted in his comment failed to preserve xml. Your command should look more like that in the original post, along with the -uri parameter. Let me try here:

    splunk _internal rpc-auth ‘<call name=”syncAuth”><params/></call>’ -uri https://localhost:8089 -auth admin:changeme

    Again, the -uri is only necessary if you explicitly want to target a Splunk instance different from what your configs specify.

  5. Chris Says:

    Thank you for clarifying. This time it worked.

    Chris

  6. Chris Says:

    Did anyone every experience that reloading the LDAP authentication using the CLI method has mixed results? Sometimes it returns all users for a distribution list, while other times it only returns one or two users…

  7. amrit Says:

    The call you’re making at the CLI is the exact same call that the UI makes when you hit Reload Authentication, so if you’re getting weird results, I’d point towards either some sort of configuration issue, or a backend bug.

  8. birdonthehood Says:

    How can I do this in 4.0?

  9. amrit Says:

    it’s a little diff - look for a post coming up later today :)

  10. Reload 4 Auth » amrit Says:

    [...] will be a very brief post, to fulfill my obligations. I’ll share something a little more informative, perhaps even more interesting, in an [...]

Leave a Reply