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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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!

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 ...