Splunk Dev

Can I deploy a new view using the rest api?

jameshgibson
Path Finder

I have some scripts that generate a view with some saved searches based on a template. I can add in the saved searches using the rest api but I dont see anyway to add the view. Is this possible?

Tags (2)
0 Karma
1 Solution

dart
Splunk Employee
Splunk Employee

Yes you can do this using the https://localhost:8089/services/data/ui/views/ endpoint.

(If you hit in the browser as https://localhost:8089/services/data/ui/views/_new it will give you documentation on what is required.

The view xml is eai:data and the object name is name (that's what's used in the URI).

View solution in original post

dart
Splunk Employee
Splunk Employee

Yes you can do this using the https://localhost:8089/services/data/ui/views/ endpoint.

(If you hit in the browser as https://localhost:8089/services/data/ui/views/_new it will give you documentation on what is required.

The view xml is eai:data and the object name is name (that's what's used in the URI).

jameshgibson
Path Finder

thanks for pointing me in the right direction, I am not sure how to call this from Python. I am using the splunk.binding module, any chance you could give a quick example? Thanks.

0 Karma
Get Updates on the Splunk Community!

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...