Reporting

How to test REST calls by embedding a report?

seanbrhn3
Explorer

I have created a test website to determine whether I can insert splunk dashboards onto it. I have installed the Rest API onto my splunk web to POST onto it however that is as far as I have gotten. I have done my research and I am still not sure how I am to use the REST API. Maybe I should just use forwarders? If any one has any documentation or information pertaining to this you will be greatly appreciated thank you.

Tags (2)
0 Karma
1 Solution

barakreeves
Splunk Employee
Splunk Employee

An easy way to do a quest REST test by embedding a report, not dashboard, is to embed a scheduled report into your web page. This is how you do it:

  • create a search such as: index=* error | stats count by host
  • save as report
  • from the Reports menu, select your report and have it run on schedule
  • go back to the reports menu and select Edit by your report and select Embed
  • after that, you will get the html iframe code which includes a REST call.

that is the easy way to test REST calls.

download one or more of the SDKs, such as Javascript, which provides wrappers around REST calls. Play with the sample code and build from there.

Thanks,
Barak

View solution in original post

seanbrhn3
Explorer

1st one I am assumed you need that rest api

0 Karma

barakreeves
Splunk Employee
Splunk Employee

An easy way to do a quest REST test by embedding a report, not dashboard, is to embed a scheduled report into your web page. This is how you do it:

  • create a search such as: index=* error | stats count by host
  • save as report
  • from the Reports menu, select your report and have it run on schedule
  • go back to the reports menu and select Edit by your report and select Embed
  • after that, you will get the html iframe code which includes a REST call.

that is the easy way to test REST calls.

download one or more of the SDKs, such as Javascript, which provides wrappers around REST calls. Play with the sample code and build from there.

Thanks,
Barak

seanbrhn3
Explorer

Sadly I have sharepoint 2010 not 2013 so this article didn't help to much I keep researching I'll keep you upated

0 Karma

barakreeves
Splunk Employee
Splunk Employee

@seanbrhn3: this sounds like a SharePoint thing. There are some security concerns with IFRAME so some CMS tighten the embedding rules on this. here is a link I found that may help. Please let us know if this works or not. It will not be the last time someone such as yourself runs into this issue: http://lennytech.wordpress.com/2012/10/18/html-field-security-and-usage-of-iframes-in-sharepoint-201...

0 Karma

seanbrhn3
Explorer

I tried that but embedding is enabled I put the report in other sites and it worked. The site I am trying to get it in is share point 2010 and every time I put the iframe in the sight instead of showing the dashboard it shows the page that I am in within the iframe?

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You don't need any SDKs, just adding the iframe to the page is enough. To simplify, take the looooong URL from the iframe and open it in your browser directly. If that fails then make sure embedding and scheduling still are enabled.

seanbrhn3
Explorer

"Cannot retrieve the URL specified in the Content Link property. For more assistance, contact your site administrator.": the test website worked when I put the iframe in but when I put it in a different website this error pops up. Maybe it because I did'nt add the javascript sdk but I dont think I needed it if I am just suppose to paste the iframe in.

0 Karma

barakreeves
Splunk Employee
Splunk Employee

glad i could help a fellow splunk user!

0 Karma

seanbrhn3
Explorer

Your awesome thank you

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

I'm a little confused. Are you trying to

  • embed Splunk reports/dashboards into a 3rd party website?
  • configure Splunk through its REST API from a 3rd party tool?
  • forward data for Splunk to index?
  • index data from 3rd party REST APIs into Splunk?
  • something else?
Get Updates on the Splunk Community!

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...