I tried a lot but couldn’t figure out the way to CREATE DASHBOARDS using splunk SDK.
Here is the snapshot of the code I tried. Can someone please help me in code to create dashboards using splunk sdk.
JobArgs jobargs = new JobArgs();
jobargs.put("name", "TestAutomation1");
jobargs.put("eai:data", "<dashboard><label>the_Automation_new_label</label></dashboard>");
jobargs.put("eai:type", "views");
jobargs.put("eai:userName", "admin");
jobargs.put("isDashboard", true);
jobargs.put("isVisible", true);
jobargs.put("label", "the_Automation_new_label");
jobargs.put("rootNode", "dashboard");
HttpService httpService = new HttpService(splunk_host);
ResponseMessage response = httpService.post("/servicesNS/admin/search/data/ui/views/_new",jobargs);
When i run this code, it always ends up as 401--unauthorized exception. I am establish connection prior to this code which executes perfectly. Am i doing it right? Can some one please help me to create dashboards/views using java sdk. Thank you!
... View more