Splunk Cloud Platform

How to use Splunk REST API to create/update a role with more than 1 index access?

premrajvs
Explorer

I am trying to create roles via API and here is the curl request. Question I have is, I am not able to add more than 1 index to the srchIndexesAllowed field either when I create the role or when I update the role. I am not able to find any Splunk documentation around the request body.

Does anyone know how I can add/update multiple indexes for a role.

 

 

 

curl --location 'https://XXXXXXXXXXXXXXX/services/authorization/roles/fi_a00002-namespace_nonprod_power' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic XXXXXXXXXXXXXXXX' \
--data-urlencode 'imported_roles=user' \
--data-urlencode 'srchIndexesAllowed=index1,index2' \
--data-urlencode 'srchIndexesDefault=index1,index2'

 

 

 

Labels (1)
Tags (1)
0 Karma

jalecrim_decat
New Member

Trying the same here, getting an error while having the proper permissions:
{"messages":[{"type":"ERROR","text":"Current user doesn't have permission to add index test"}]}

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

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