Reporting

How to run a report with SDK?

zacharysyoung
Explorer

Is it possible to run a saved report with SDK (either JS or Python)? I'd like to get back the <canvas> object if possible.

I was not able to get the JS example of charting to work, but that looks like defining the search on the fly and then charting it. Searching the docs has not turned up anything that looks pertitent, neither has grepping the JavaScript or Python projects from Git.

Thank you,

Tags (2)
0 Karma
1 Solution

psanford_splunk
Splunk Employee
Splunk Employee

If you are working with stats in saved searches we have a lot of support for saved searches in the SDKs.

However, if you are really looking at running the reports, we don't support that as of right now in the SDKs.

There are REST endpoints for running the views. Take a look at these in the REST docs: http://docs.splunk.com/Documentation/Splunk/5.0/RESTAPI/RESTsearch#scheduled.2Fviews

Not sure if that will be helpful, but let me know.

View solution in original post

0 Karma

psanford_splunk
Splunk Employee
Splunk Employee

If you are working with stats in saved searches we have a lot of support for saved searches in the SDKs.

However, if you are really looking at running the reports, we don't support that as of right now in the SDKs.

There are REST endpoints for running the views. Take a look at these in the REST docs: http://docs.splunk.com/Documentation/Splunk/5.0/RESTAPI/RESTsearch#scheduled.2Fviews

Not sure if that will be helpful, but let me know.

0 Karma

ineeman
Splunk Employee
Splunk Employee

Zachary, you are correct. There is no way today to get a <canvas> element. This is because it is not self-contained, it depends on JavaScript, CSS and other things on the page that are not easily embeddable today. One option is to run the search using the SDK, and then use the built-in charting components in the JS SDK to display it on your page.

0 Karma

zacharysyoung
Explorer

Hi, and thank you for your answer. I followed that RESTAPI link, and I had seen that earlier, but it seems like it can only e-mail a PDF. If I want the CANVAS object, to redisplay in a web page, I'll need to scrape the site using the DOM (it's been a while since I scraped, so that term may not be accurate), it seems like. Is this correct?

Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...