Dashboards & Visualizations

Want results onload for unique scenario

ma_anand1984
Contributor

My Dashboard looks like below
I have set 2 hours as default time. I wanted my app to show results onload. How can i achieve

Timepicker
submit button
     searchString (summary search) autorun = true
        post process1 autorun = true
        .....
        .....
        post processN autorun = true
    End searchString (summary search)
    searchString (raw search) autorun = true
        post process1 autorun = true
        .....
        post processN autorun = true
    End searchString (raw search)
End submit button
End Timepicker
1 Solution

sideview
SplunkTrust
SplunkTrust

You should remove the autoRun="True" attributes you have lower down and just put a single autoRun="True" up on the TimeRangePicker module. I think that might be your only problem.

Sometimes people think there's something special about the Search module or the HiddenSearch module that dictates that autoRun attributes always have to go there. autoRun="True" however, just means "start a push from this point when the page loads". You can think of an autoRun="True" attribute as an invisible SubmitButton module that inserts itself right there, gets clicked (thus initiating the push), and then dissappears. Once you think of it this way you should see how evil and problematic it would be to have lots and lots of autoRun="True" all over the place.

Anyway, I think what's happening is that your autoRun="True" attributes lower down, are initiating their pushes before the upper search even runs at all.

View solution in original post

sideview
SplunkTrust
SplunkTrust

You should remove the autoRun="True" attributes you have lower down and just put a single autoRun="True" up on the TimeRangePicker module. I think that might be your only problem.

Sometimes people think there's something special about the Search module or the HiddenSearch module that dictates that autoRun attributes always have to go there. autoRun="True" however, just means "start a push from this point when the page loads". You can think of an autoRun="True" attribute as an invisible SubmitButton module that inserts itself right there, gets clicked (thus initiating the push), and then dissappears. Once you think of it this way you should see how evil and problematic it would be to have lots and lots of autoRun="True" all over the place.

Anyway, I think what's happening is that your autoRun="True" attributes lower down, are initiating their pushes before the upper search even runs at all.

ma_anand1984
Contributor

Thank so lot, you exactly got the problem. It worked like a charm

0 Karma

MHibbin
Influencer

I'm assuming you are using advanced XML, if not I think you will need to.

I believe you should look at the module refence, specifically the "SubmitButton" module

(http://docs.splunk.com/Documentation/Splunk/latest/Developer/ModuleReference#SubmitButton)

You should then look at the "allowSoftSubmit" parameter. This defaults to false, which requires user to select the "Search" button to generate results in a form.

Regards,

MHibbin

0 Karma

ma_anand1984
Contributor

I "yay"ed my dashboard 🙂 thank you

0 Karma

sideview
SplunkTrust
SplunkTrust

Since you're already using Sideview Utils you should consider using SearchControls instead of JobStatus and JobStatusMin. Also delete the HiddenFieldPicker, ViewStateAdapter and Gimp modules. And delete all the "groupLabel" attributes. None of those are doing anything here so you can safely delete them and save your eyesight. Also while you're at it de-nest all of the child modules from JobProgressIndicator and EnablePreview. It's meaningless for those two modules to contain child modules so the only change from de-nesting them will be to make your view less indented (yay).

ma_anand1984
Contributor

With the below code. My page is not generating graphs as expected. It loads only on pressing submit button.



Last 2 hours
False

True

True
Submit

True

False
False
progress
False
False

300

some search

some search
some label


True


True
False

Hits
top
line
Time

100%



flashtimeline




flashtimeline








some search
some label


True


True
False

Response Time (ms)
top
line
Time
zero

100%



flashtimeline







0 Karma

ma_anand1984
Contributor

@Ayn let me know if you need more information

0 Karma

ma_anand1984
Contributor

Now i have to hit submit button to load. I want the page to show charts as soon as i visit the dashboard.

Please note that putting timepicker and submit module inside searchString module works. But the problem is i want the time picker to be common for both search string modules

0 Karma

Ayn
Legend

What do you mean by "show results onload"? What's the current behaviour, and how does it differ from how you want it to behave?

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