Dashboards & Visualizations

How to get all results from multi page search results table?

splunkhmcv
Loves-to-Learn

Hi!

I have a dashboard that has search input fields that allow to run a search and the results are displayed on the table. 

I want to create a custom button to act on the data from the search. I don't want to repeat the search using tokens and searchmanager.

Is it possible to load the full results from the table on javascript in the case of a multi page table like this :

splunkhmcv_0-1654185936540.png

I know it's possible to download a .csv file using the SID from the search but I want to know if there is other way to do it.

 

I can extract the data from the table page that's currently rendered on the dashboard.

 

Thank you in advance.

Labels (5)
0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

@splunkhmcv - You can do it with the search id.

Assign id to search in XML, like

<table>
  <search id="my_search">
    <query>....

 

And you can read the same results in the JS like:

// Imports
require([
        'splunkjs/mvc', 
...


// read the same search results
let mySearchManager = mvc.Components.get("my_search");
let myResults = mySearchManager.data("results");
        myResults.on("data", function () {
            resultArray = myResults.data().rows;
            $.each(resultArray, function (index, value) {
                console.log(value);
            });
        });

 

I hope this helps!!!

0 Karma
Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...