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!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...