Dashboards & Visualizations

Modify dashboard using REST API

neptoon
Engager

I'd like to modify a dashboard's content using the REST API (for example add another report or an HTML panel). Is there a proper way to do it?

I found out that I can get the dashboard information and source by issuing a GET request to https://$server$:8089/servicesNS/$user$/$app$/data/ui/views/$dashboardName$

I tried to POST to the same URI with a "data=..." request body, containing the dashboard source, but I get an error:

In handler 'views': Argument " Average usage </searchName> <option name" is not supported by this handler.

Tags (2)
0 Karma

chujun1990
Engager

Hi, i believe you might have included {name: 'your_dashboard_name'} in the data your are posting.
For creating new dashboard, you need:
1. URL: https://$server$:8089/servicesNS/$user$/$app$/data/ui/views/
(Notice that please don't include the dashboard name in the url)
2. data {'name': 'dashboard_name', 'eai:data': 'dashboard_xml_definition'}

For updating existing dashboard, you need:
1. URL: https://$server$:8089/servicesNS/$user$/$app$/data/ui/views/$dashboardName$
(Notice that please include the dashboard name)
2. data {'eai:data': 'dashboard_xml_definition'}
(Notice that don't include the name param)

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