Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Dashboards & Visualizations

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- Splunk Answers
- :
- Using Splunk
- :
- Dashboards & Visualizations
- :
- Re: Disable Code From Running

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark Topic
- Subscribe to Topic
- Mute Topic
- Printer Friendly Page

- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Disable Code From Running

IRHM73

Motivator

04-02-2019
11:53 PM

Hi,

I wonder whether someone could help me please:

I'm using the following XML dashboard script with dynamic panels dependent on user selection of a drop down menu:

```
<?xml version="1.0" encoding="UTF-8"?>
<form>
<search>
<query>| makeresults</query>
<earliest>$time.earliest$</earliest>
<latest>$time.latest$</latest>
<progress>
<eval token="toEarliest">strptime($job.earliestTime$,"%Y-%m-%dT%H:%M:%S..%3N%z")</eval>
<eval token="toLatest">strptime($job.latestTime$,"%Y-%m-%dT%H:%M:%S..%3N%z")</eval>
<set token="jobEarliest">$job.earliestTime$</set>
<set token="jobLatest">$job.latestTime$</set>
</progress>
</search>
<label>CoDE Company Car Data V2</label>
<fieldset submitButton="false">
<input type="dropdown" token="selectdata">
<label>Select the Data Range</label>
<choice value="pre2019">Pre 2019</choice>
<choice value="2019Onwards">2019 - Current</choice>
<change>
<condition value="pre2019">
<set token="show_pre2019">true</set>
<unset token="show_2019Onwards"></unset>
</condition>
<condition value="2019Onwards">
<set token="show_2019Onwards">true</set>
<unset token="show_pre2019"></unset>
</condition>
<condition>
<unset token="show_2019Onwards"></unset>
<unset token="show_pre2019"></unset>
</condition>
</change>
</input>
<input type="time" token="time">
<label>Please select the time range</label>
<default>
<earliest>-24h@h</earliest>
<latest>now</latest>
</default>
</input>
</fieldset>
<row>
<panel depends="$show_pre2019$" rejects="$show_2019Onwards$">
<title>Pre 2019</title>
<table>
<search>
<query> index=summary_dg_code report=Login2018codedata
| stats sum(eval(if(signout="1", "1", ""))) as signout sum(eval(if(PA="1", "1", ""))) as PA sum(eval(if(PA_PF="1", "1", ""))) as PTA_PREF sum(eval(if(PA_AD="1", "1", ""))) as PA_AD sum(eval(if(PA_AD_D="1", "1", ""))) as PTA_AD_D sum(eval(if(PA_I="1", "1", ""))) as PA_I sum(eval(if(PA_I_Letter="1", "1", ""))) as PA_I_Letter sum(eval(if(PA_S="1", "1", ""))) as PA_A sum(eval(if(income="1", "1", ""))) as income sum(eval(if(income_ben="1", "1", ""))) as income_ben sum(eval(if(income_update="1", "1", ""))) as income_update sum(eval(if(income_print="1", "1", ""))) as income_print sum(eval(if(car="1", "1", ""))) as car sum(eval(if(car_sub="1", "1", ""))) as car_sub sum(eval(if(ben="1", "1", ""))) as ben sum(eval(if(ben_submit="1", "1", ""))) as ben_sub sum(eval(if(NP="1", "1", ""))) as NP sum(eval(if(calc="1", "1", ""))) as calc sum(eval(if(ts="1", "1", ""))) as ts sum(eval(if(ts_CoC="1", "1", ""))) as ts_C sum(eval(if(ts_C_sub="1", "1", ""))) as ts_C_sub sum(eval(if(s_schedule="1", "1", ""))) as s_schedule sum(eval(if(t="1", "1", ""))) as t sum(eval(if(t_sub="1", "1", ""))) as t_sub sum(eval(if(forms="1", "1", ""))) as forms sum(eval(if(payments="1", "1", ""))) as payments sum(eval(if(rep="1", "1", ""))) as rep sum(eval(if(rep_sub="1", "1", ""))) as rep_sub sum(eval(if(forms_ChB="1", "1", ""))) as forms_CB sum(eval(if(forms_C="1", "1", ""))) as forms_C sum(eval(if(forms_P="1", "1", ""))) as forms_P sum(eval(if(forms_S="1", "1", ""))) as forms_S sum(eval(if(forms_sub="1", "1", ""))) as forms_submit by "X-sessionId" time endtime nino login EEpoch LEpoch
| eval earliest = $toEarliest$ | eval latest = if($toLatest$ < 0,now(),$toLatest$)
| where EEpoch >=earliest AND LEpoch <=latest
| fields - EEpoch LEpoch earliest latest </query>
</search>
<option name="drilldown">none</option>
</table>
</panel>
</row>
<row>
<panel depends="$show_2019Onwards$" rejects="$show_pre2019$">
<title>2019 - Current</title>
<table>
<search>
<query>index=summary_dg_code report=Login2019codedata
| stats sum(eval(if(signout="1", "1", ""))) as signout sum(eval(if(PA="1", "1", ""))) as PA sum(eval(if(PA_PF="1", "1", ""))) as PTA_PREF sum(eval(if(PA_AD="1", "1", ""))) as PA_AD sum(eval(if(PA_AD_D="1", "1", ""))) as PTA_AD_D sum(eval(if(PA_I="1", "1", ""))) as PA_I sum(eval(if(PA_I_Letter="1", "1", ""))) as PA_I_Letter sum(eval(if(PA_S="1", "1", ""))) as PA_A sum(eval(if(income="1", "1", ""))) as income sum(eval(if(income_ben="1", "1", ""))) as income_ben sum(eval(if(income_update="1", "1", ""))) as income_update sum(eval(if(income_print="1", "1", ""))) as income_print sum(eval(if(car="1", "1", ""))) as car sum(eval(if(car_sub="1", "1", ""))) as car_sub sum(eval(if(ben="1", "1", ""))) as ben sum(eval(if(ben_submit="1", "1", ""))) as ben_sub sum(eval(if(NP="1", "1", ""))) as NP sum(eval(if(calc="1", "1", ""))) as calc sum(eval(if(ts="1", "1", ""))) as ts sum(eval(if(ts_CoC="1", "1", ""))) as ts_C sum(eval(if(ts_C_sub="1", "1", ""))) as ts_C_sub sum(eval(if(s_schedule="1", "1", ""))) as s_schedule sum(eval(if(t="1", "1", ""))) as t sum(eval(if(t_sub="1", "1", ""))) as t_sub sum(eval(if(forms="1", "1", ""))) as forms sum(eval(if(payments="1", "1", ""))) as payments sum(eval(if(rep="1", "1", ""))) as rep sum(eval(if(rep_sub="1", "1", ""))) as rep_sub sum(eval(if(forms_ChB="1", "1", ""))) as forms_CB sum(eval(if(forms_C="1", "1", ""))) as forms_C sum(eval(if(forms_P="1", "1", ""))) as forms_P sum(eval(if(forms_S="1", "1", ""))) as forms_S sum(eval(if(forms_sub="1", "1", ""))) as forms_submit by "X-sessionId" time endtime nino login EEpoch LEpoch
| eval earliest = $toEarliest$ | eval latest = if($toLatest$ < 0,now(),$toLatest$)
| where EEpoch >=earliest AND LEpoch <=latest
| fields - EEpoch LEpoch earliest latest</query>
</search>
<option name="drilldown">none</option>
</table>
</panel>
</row>
</form>
```

The problem I have is that when the user selects the second panel, the first correctly is hidden, but it takes an inordinate amount of time to extract the data and I suspect that it's because the first query is still running.

Could someone tell me please is there a way in which I can stop the first query running?

Many thanks and kind regards

Chris

- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

IRHM73

Motivator

04-03-2019
02:35 AM

Hi @vnravikumar.

Thank you for this.

Unfortunately this doesn't seem to have made any difference to the load time.

Many thanks and kind regards

Chris

- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

bwlm

Path Finder

04-23-2020
11:03 PM

- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

vnravikumar

Champion

04-03-2019
12:52 AM

Hi

Give a try, I had dummy eval at the end of the query.

```
<form>
<search>
<query>| makeresults</query>
<earliest>$time.earliest$</earliest>
<latest>$time.latest$</latest>
<progress>
<eval token="toEarliest">strptime($job.earliestTime$,"%Y-%m-%dT%H:%M:%S..%3N%z")</eval>
<eval token="toLatest">strptime($job.latestTime$,"%Y-%m-%dT%H:%M:%S..%3N%z")</eval>
<set token="jobEarliest">$job.earliestTime$</set>
<set token="jobLatest">$job.latestTime$</set>
</progress>
</search>
<label>CoDE Company Car Data V2</label>
<fieldset submitButton="false">
<input type="dropdown" token="selectdata">
<label>Select the Data Range</label>
<choice value="pre2019">Pre 2019</choice>
<choice value="2019Onwards">2019 - Current</choice>
<change>
<condition value="pre2019">
<set token="show_pre2019">true</set>
<unset token="show_2019Onwards"></unset>
</condition>
<condition value="2019Onwards">
<set token="show_2019Onwards">true</set>
<unset token="show_pre2019"></unset>
</condition>
<condition>
<unset token="show_2019Onwards"></unset>
<unset token="show_pre2019"></unset>
</condition>
</change>
</input>
<input type="time" token="time">
<label>Please select the time range</label>
<default>
<earliest>-24h@h</earliest>
<latest>now</latest>
</default>
</input>
</fieldset>
<row>
<panel depends="$show_pre2019$" rejects="$show_2019Onwards$">
<title>Pre 2019</title>
<table>
<search>
<query> index=summary_dg_code report=Login2018codedata
| stats sum(eval(if(signout="1", "1", ""))) as signout sum(eval(if(PA="1", "1", ""))) as PA sum(eval(if(PA_PF="1", "1", ""))) as PTA_PREF sum(eval(if(PA_AD="1", "1", ""))) as PA_AD sum(eval(if(PA_AD_D="1", "1", ""))) as PTA_AD_D sum(eval(if(PA_I="1", "1", ""))) as PA_I sum(eval(if(PA_I_Letter="1", "1", ""))) as PA_I_Letter sum(eval(if(PA_S="1", "1", ""))) as PA_A sum(eval(if(income="1", "1", ""))) as income sum(eval(if(income_ben="1", "1", ""))) as income_ben sum(eval(if(income_update="1", "1", ""))) as income_update sum(eval(if(income_print="1", "1", ""))) as income_print sum(eval(if(car="1", "1", ""))) as car sum(eval(if(car_sub="1", "1", ""))) as car_sub sum(eval(if(ben="1", "1", ""))) as ben sum(eval(if(ben_submit="1", "1", ""))) as ben_sub sum(eval(if(NP="1", "1", ""))) as NP sum(eval(if(calc="1", "1", ""))) as calc sum(eval(if(ts="1", "1", ""))) as ts sum(eval(if(ts_CoC="1", "1", ""))) as ts_C sum(eval(if(ts_C_sub="1", "1", ""))) as ts_C_sub sum(eval(if(s_schedule="1", "1", ""))) as s_schedule sum(eval(if(t="1", "1", ""))) as t sum(eval(if(t_sub="1", "1", ""))) as t_sub sum(eval(if(forms="1", "1", ""))) as forms sum(eval(if(payments="1", "1", ""))) as payments sum(eval(if(rep="1", "1", ""))) as rep sum(eval(if(rep_sub="1", "1", ""))) as rep_sub sum(eval(if(forms_ChB="1", "1", ""))) as forms_CB sum(eval(if(forms_C="1", "1", ""))) as forms_C sum(eval(if(forms_P="1", "1", ""))) as forms_P sum(eval(if(forms_S="1", "1", ""))) as forms_S sum(eval(if(forms_sub="1", "1", ""))) as forms_submit by "X-sessionId" time endtime nino login EEpoch LEpoch
| eval earliest = $toEarliest$ | eval latest = if($toLatest$ < 0,now(),$toLatest$)
| where EEpoch >=earliest AND LEpoch <=latest
| fields - EEpoch LEpoch earliest latest |eval temp=$show_pre2019$ </query>
</search>
<option name="drilldown">none</option>
</table>
</panel>
</row>
<row>
<panel depends="$show_2019Onwards$" rejects="$show_pre2019$">
<title>2019 - Current</title>
<table>
<search>
<query>index=summary_dg_code report=Login2019codedata
| stats sum(eval(if(signout="1", "1", ""))) as signout sum(eval(if(PA="1", "1", ""))) as PA sum(eval(if(PA_PF="1", "1", ""))) as PTA_PREF sum(eval(if(PA_AD="1", "1", ""))) as PA_AD sum(eval(if(PA_AD_D="1", "1", ""))) as PTA_AD_D sum(eval(if(PA_I="1", "1", ""))) as PA_I sum(eval(if(PA_I_Letter="1", "1", ""))) as PA_I_Letter sum(eval(if(PA_S="1", "1", ""))) as PA_A sum(eval(if(income="1", "1", ""))) as income sum(eval(if(income_ben="1", "1", ""))) as income_ben sum(eval(if(income_update="1", "1", ""))) as income_update sum(eval(if(income_print="1", "1", ""))) as income_print sum(eval(if(car="1", "1", ""))) as car sum(eval(if(car_sub="1", "1", ""))) as car_sub sum(eval(if(ben="1", "1", ""))) as ben sum(eval(if(ben_submit="1", "1", ""))) as ben_sub sum(eval(if(NP="1", "1", ""))) as NP sum(eval(if(calc="1", "1", ""))) as calc sum(eval(if(ts="1", "1", ""))) as ts sum(eval(if(ts_CoC="1", "1", ""))) as ts_C sum(eval(if(ts_C_sub="1", "1", ""))) as ts_C_sub sum(eval(if(s_schedule="1", "1", ""))) as s_schedule sum(eval(if(t="1", "1", ""))) as t sum(eval(if(t_sub="1", "1", ""))) as t_sub sum(eval(if(forms="1", "1", ""))) as forms sum(eval(if(payments="1", "1", ""))) as payments sum(eval(if(rep="1", "1", ""))) as rep sum(eval(if(rep_sub="1", "1", ""))) as rep_sub sum(eval(if(forms_ChB="1", "1", ""))) as forms_CB sum(eval(if(forms_C="1", "1", ""))) as forms_C sum(eval(if(forms_P="1", "1", ""))) as forms_P sum(eval(if(forms_S="1", "1", ""))) as forms_S sum(eval(if(forms_sub="1", "1", ""))) as forms_submit by "X-sessionId" time endtime nino login EEpoch LEpoch
| eval earliest = $toEarliest$ | eval latest = if($toLatest$ < 0,now(),$toLatest$)
| where EEpoch >=earliest AND LEpoch <=latest
| fields - EEpoch LEpoch earliest latest |eval temp=$show_2019Onwards$</query>
</search>
<option name="drilldown">none</option>
</table>
</panel>
</row>
</form>
```

Get Updates on the Splunk Community!

Splunk Education believes in the value of training and certification in today’s rapidly-changing data-driven ...

As security threats and their complexities surge, security analysts deal with increased challenges and ...

January 2023New Product Releases Splunk Network Explorer for Infrastructure MonitoringSplunk unveils Network ...