Quantcast
Channel: Latest Questions on Splunk Answers
Viewing all articles
Browse latest Browse all 13053

Create a User using the PHP SDK

$
0
0

I'm building a PHP web app that uses the Splunk PHP SDK and I've hit a brick wall trying to create a new Splunk user.

Ideally when a user account is created in my app, a corresponding account should be created in Splunk with the same credentials.

I've read up on the REST documentation and found the correct Endpoint - authentication/users/ but as far as I can tell the PHP SDK does not support creating an Entity that is not part of a Collection as Splunk_Entity does not have a create() method.

I have successfully created dashboards using the SDK which are Splunk_Collection objects, and gathered system info from server/info as a Splunk_Entity.

I have attempted to create a user by using create() on a Splunk_Collection, but as authentication/users does not have a namespace when the collection is returned a fatal is thrown attempting to check the non-existent namespace:

Fatal error: Call to a member function children() on a non-object in /var/www/html/dev/plugins/splunk_connector/sdk/Splunk/AtomFeed.php on line 45

In summary, my questions are:

  • How (if at all) can I create an Entity using the PHP SDK?
  • How do I create a User using the authenticaiton/users Endpoint?

Viewing all articles
Browse latest Browse all 13053

Trending Articles