Splunk Dev

Create user using the REST API

wagnerbianchi
Splunk Employee
Splunk Employee

I'm developing some stuff using SDK, accessing data inside Splunk. As mentioned on this page (http://dev.splunk.com/view/splunk-sdk/SP-CAAADP7), "each of Splunk's resources (apps, users, searches, jobs, indexes, inputs, and others) has a corresponding REST endpoint that indicates the resource's category", I am looking for a way to read a CSV file the contains usernames and passwords so as to create all the users I must create using this SDK resource.

Someone has done this kind of thing before?

Tags (1)
0 Karma

wagnerbianchi
Splunk Employee
Splunk Employee

I found an example using php: http://dev.splunk.com/view/php-sdk/SP-CAAAEJM

0 Karma

Damien_Dallimor
Ultra Champion

If you browse to the CSharp SDK on github , you can see a code example of creating a user in the unit tests.

https://github.com/splunk/splunk-sdk-csharp/blob/master/UnitTests/UserTest.cs

wagnerbianchi
Splunk Employee
Splunk Employee

Hey guys, for this time I am going ahead interacting with Splunk through command line...

=> http://docs.splunk.com/Documentation/Splunk/5.0.3/Security/ConfigureuserswiththeCLI

But, if you guys are able to share a simple code to create users using the SDK, it will help either for future developments.

Thanks a lot.

0 Karma

wagnerbianchi
Splunk Employee
Splunk Employee

Just to share the solution I have in mind: I will wrap the command to create users through Splunk CLI and will read username and password from file/database table.

0 Karma

wagnerbianchi
Splunk Employee
Splunk Employee

I'm using C# ... Could you provide an example please? Thanks!

0 Karma

Damien_Dallimor
Ultra Champion

Which language SDK ? , so we can provide a more specific code example.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...