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!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...