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!

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