External data and content

Very quickly, we will mention ways to pull in additional data from external sources. These can be external data sources, or more likely, internal API calls to internal services.

Data

Say you have an internal monitoring solution that has an API. Since you want to be efficient in both the collection of data and the storage of data, you only want to collect and store the performance data in the internal monitoring solution. However, how can you integrate the API data with the performance data? Simply put, you can build a script input that consumes the API data and stores the resulting performance data in a lookup that you can use to automatically enhance the data. You can also use jQuery to pull that data right into the dashboard and use the D3 visualizations as well as the built-in JavaScript objects to visualize it. This is done quite simply by using the Ajax library of jQuery:

$.ajax({
  url: "http://myinternalserver.example.com/getNode/myNode"
})
  .done(function( data ) {
    if ( console && console.log ) {
      console.log( data );
    }
  });

Very simply, this performs a GET on the URL provided and returns the data into the done function. From there, you can manipulate it in any way you wish and use it to enhance your dashboard even further.

Content

Including CSS and JS on the page is very simple—although, due to cross-site scripting concerns, it is not recommended. It is very possible to include an iframe on the page, in order to display the latest rendering of the page. You can also include JavaScript libraries and modules from external sources but the browser has to be enabled to allow it since it can be a security risk. There are also performance considerations to consider, so if it is at all possible, download the libraries and modules to the static folder and serve it locally from Splunk.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.182.45