Security

Is there a flat file where Splunk user names and assigned roles stored?

jrdba
Explorer

Hi folks, I was wondering if there was a flat file that exists where user account names & their assigned roles are stored? I'm not trying to get passwords, just user names and assigned roles which we manually create. I'm trying to automate this process via powershell. Manual process is taking too long. Thank you much 🙂

Access control | Users | New button

0 Karma
1 Solution

vasanthmss
Motivator

Hi,

Below Search will help you to get the list of users, and you can write it in to csv / flat file.

|rest /services/authentication/users splunk_server=local |fields title roles realname email|rename title as userName|rename realname as Name | table Name, userName, email, roles | stats values(*) as * by userName delim=", " | nomv roles

You can use the command line / REST to create user. Either way you can do the same thing in your script,

Read this Doc

 1. Write a script to search list of users and their roles (the above search query) and output your results to CSV/flat file. So you can access the csv/flat file from your script.
 2. using REST / Command line user insert you can create n number of users.

Cheers!

V

View solution in original post

vasanthmss
Motivator

Hi,

Below Search will help you to get the list of users, and you can write it in to csv / flat file.

|rest /services/authentication/users splunk_server=local |fields title roles realname email|rename title as userName|rename realname as Name | table Name, userName, email, roles | stats values(*) as * by userName delim=", " | nomv roles

You can use the command line / REST to create user. Either way you can do the same thing in your script,

Read this Doc

 1. Write a script to search list of users and their roles (the above search query) and output your results to CSV/flat file. So you can access the csv/flat file from your script.
 2. using REST / Command line user insert you can create n number of users.

Cheers!

V

jrdba
Explorer

When i try to run a CLI command to add a dummy user account i get an error about non existent role. I can see the role exists in the admin web page under the "roles" column....

Ran command like this...

d:_programfiles_splunk_bin> .\splunk.exe add user michael -password changeme -role app-test -auth admin:[our password]

"In handler 'users' : Error creating user. role="app-test" does not exist"

Why would this be happening? Thanks for assistance

0 Karma

jrdba
Explorer

I just realized basically run this search on the GUI. Thanks

0 Karma
Get Updates on the Splunk Community!

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

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 ...