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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...