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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...