Getting Data In

update default.meta stanzas using REST API

ganesh_crms
New Member

Hi All,
How to update default.meta stanzas using REST API. Thanks in Advance.

0 Karma
1 Solution

harsmarvania57
Ultra Champion

Hi,

To change views permissions using REST API, you can use below REST API (In below example please change values for <> based on your environment.

To change permissions of particular dashboard

curl -vk -u user:password https://<your_splunk_server>:8089/servicesNS/<username>/<app_name>/data/ui/views/<dashboard_name>/ac... -d "perms.read"="user" -d "perms.write"="user" -d sharing=<app/user/global> -d owner=<owner_name>

To change permissions of dashboards page, try below REST API.

curl -vk -u user:password https://<your_splunk_server>:8089/servicesNS/nobody/<app_name>/data/ui/views/_acl -d "perms.read"="user" -d "perms.write"="user" -d sharing=<app/user/global>

View solution in original post

0 Karma

harimadambi
Explorer

import requests

data = {
'owner' : '<owner>',
'sharing' : '<app/global/system>',
'perms.read' : '*',
'perms.write' : '*'
}

url = 'https://<hostname>:8089/services/apps/local/test_app/acl'
response = requests.post(url, data=data, verify=False, auth=('admin', '<password>'))

harsmarvania57
Ultra Champion

Hi,

To change views permissions using REST API, you can use below REST API (In below example please change values for <> based on your environment.

To change permissions of particular dashboard

curl -vk -u user:password https://<your_splunk_server>:8089/servicesNS/<username>/<app_name>/data/ui/views/<dashboard_name>/ac... -d "perms.read"="user" -d "perms.write"="user" -d sharing=<app/user/global> -d owner=<owner_name>

To change permissions of dashboards page, try below REST API.

curl -vk -u user:password https://<your_splunk_server>:8089/servicesNS/nobody/<app_name>/data/ui/views/_acl -d "perms.read"="user" -d "perms.write"="user" -d sharing=<app/user/global>
0 Karma

harsmarvania57
Ultra Champion

Hi,

Can you please provide more information about what you would like to change in .meta files ? Additionally it is not good idea to change anything in default.meta because it will overwrite when you upgrade the app/add-on, so best practice is to change permissions in local.meta file.

0 Karma

ganesh_crms
New Member

Hi Harsmarvania,
Thanks for your answer.
whats the use of this parameter "-d sharing=".
What value i should pass?

0 Karma

harsmarvania57
Ultra Champion

sharing means would you like to share this dashboard at user level (Private), app level or global level ?

0 Karma

ganesh_crms
New Member

Hi,
I wants to modify the "access" field (under stanzas) to restrict role base access for a view in app

0 Karma

harsmarvania57
Ultra Champion

Under which stanza ?

0 Karma

ganesh_crms
New Member

---Current---
[views/]
access = read : [ admin ], write : [ admin ]

----Expected---
[views/]
access = read : [ user], write : [user ]

0 Karma
Get Updates on the Splunk Community!

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

SignalFlow: What? Why? How?

What is SignalFlow? Splunk Observability Cloud’s analytics engine, SignalFlow, opens up a world of in-depth ...

Federated Search for Amazon S3 | Key Use Cases to Streamline Compliance Workflows

Modern business operations are supported by data compliance. As regulations evolve, organizations must ...