Getting Data In

How to use .json file as input in a POST call to the REST API

tomaskucerak
Engager

Im trying to update a role in our environment via the Splunk REST API and Im using POSTMAN like app with an input file which is holding several changes in parameters for the specified role.
The post call looks like this:

POST https://localhost:8089/services/authorization/roles/rl_user
Authorization: Bearer xxx

< ...\input.txt

And this is the content of the input file:

srchIndexesAllowed=main;srchJobsQuota=3;srchDiskQuota=300

Even though this is working quite fine, editing the input file manually like this is really unpractical.
What I would like to know is whether there is an option to first call the API to export the role in atom(xml)/json format.
Take that export, update the values I need and then import the file again via a POST API call to change the params?

I`ve been playing with this for quite some time but no luck.
Any advise is appreciated.
Thanks.

Labels (1)
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 ...