All Apps and Add-ons

search does not work in dasboard when i change drop down value

vikashperiwal
Path Finder

HI ,

I have a search for panel where i have passed token and the query in set in the xml .

problem i am facing is when i change any drop down value the panel is not getting the updated search.

Query

<input type="time" token="time" searchWhenChanged="false">
  <label>Time Selection</label>
  <default>
    <earliest>-3d@d</earliest>
    <latest>now</latest>
  </default>
</input>
<input type="dropdown" token="span" searchWhenChanged="true">
  <label>Aggregation Interval</label>
  <choice value="5m">5 minutes</choice>
  <choice value="10m">10 minutes</choice>
  <choice value="15m">15 minutes</choice>
  <choice value="30m">30 minutes</choice>
  <choice value="60m">1 hour</choice>
  <choice value="1d">1 day</choice>
  <default>15m</default>

</input>
<input type="dropdown" token="pgw" searchWhenChanged="false">
  <label>Packet Gateway</label>
  <choice value="ABBRLW-IOTEPC-01">ABBRLW-IOTEPC-01</choice>
  <choice value="BCGLMR-IOTEPC-01">BCGLMR-IOTEPC-01</choice>
  <choice value="ONHOOD-IOTEPC-01">ONHOOD-IOTEPC-01</choice>
  <choice value="PQPTFD-IOTEPC-01">PQPTFD-IOTEPC-01</choice>
  <choice value="PQPTFD-IOTEPC-02">PQPTFD-IOTEPC-02</choice>
  <choice value="WNPGMBAB-SPGW-01">WNPGMBAB-SPGW-01</choice>
  <choice value="WNPGMBAB-SPGW-02">WNPGMBAB-SPGW-02</choice>

`` ABBRLW-IOTEPC-01

<panel>
  <input type="radio" token="network_context" searchWhenChanged="true">
    <label>Source</label>
    <choice value="APNCALLPERFSTATSGRID">APNCALLPERFSTATSGRID</choice>
    <choice value="SGWAPNCALLPERFSTATSGRID">SGWAPNCALLPERFSTATSGRID</choice>
    <choice value="SGWCALLPERFSTATSGRID">SGWCALLPERFSTATSGRID</choice>
    <fieldForLabel>Filename</fieldForLabel>
    <fieldForValue>Filename</fieldForValue>
    <change>
      <condition value="APNCALLPERFSTATSGRID">
        <set token="network_context1">index=affirmed host=$pgw$ source=*APNCALLPERFSTATSGRID* apn_name=*ims*
                  | eval Attempt = (NumTotalBearersSetupSuccessQci1+NumTotalBearersSetupFailQci1)
                  | eval Success = NumTotalBearersSetupSuccessQci1
                  | eval Reject = NumTotalBearersSetupFailQci1
                  | eval Current = NumCurrentBearersQci1
                  | eval FR = if(isnull((Attempt-Success)/Attempt*100),0,(Attempt-Success)/Attempt*100)
                  | where FR >=0
                  | eval SR = if(isnull((Attempt-Reject)/Attempt*100),0,(Attempt-Reject)/Attempt*100)
                  | where SR <=100
                  | timechart span=$span$ avg(FR) as "Failure Rate", avg(SR) as  "Success Rate", avg(Current) as "Current" by host</set>
        <set token="network_context2">index=affirmed host=$pgw$ source=*APNCALLPERFSTATSGRID*  apn_name=*ims*
                  | eval Attempt = (NumTotalBearersSetupSuccessQci5+NumTotalBearersSetupFailQci5)
                  | eval Success = NumTotalBearersSetupSuccessQci5
                  | eval Reject = NumTotalBearersSetupFailQci5
                  | eval Current = NumCurrentBearersQci5
                  | eval FR = if(isnull((Attempt-Success)/Attempt*100),0,(Attempt-Success)/Attempt*100)
                  | where FR >=0
                  | eval SR = if(isnull((Attempt-Reject)/Attempt*100),0,(Attempt-Reject)/Attempt*100)
                  | where SR <=100
                  | timechart span=$span$ avg(FR) as "Failure Rate", avg(SR) as  "Success Rate", avg(Current) as "Current" by host</set>

      </condition>
      <condition value="SGWAPNCALLPERFSTATSGRID">
        <set token="network_context1">index=affirmed host=$pgw$ source=*SGWAPNCALLPERFSTATSGRID* sgwApn_name=*ims*
                  | eval Attempt = (NumTotalBearersSetupSuccessQci1+NumTotalBearersSetupFailQci1)
                  | eval Success = NumTotalBearersSetupSuccessQci1
                  | eval Reject = NumTotalBearersSetupFailQci1
                  | eval Current = NumCurrentBearersQci1
                  | eval FR = if(isnull((Attempt-Success)/Attempt*100),0,(Attempt-Success)/Attempt*100)
                  | where FR >=0
                  | eval SR = if(isnull((Attempt-Reject)/Attempt*100),0,(Attempt-Reject)/Attempt*100)
                  | where SR <=100
                  | timechart span=$span$ avg(FR) as "Failure Rate", avg(SR) as  "Success Rate", avg(Current) as "Current" by sgwApn_name</set>
        <set token="network_context2">index=affirmed host=$pgw$ source=*SGWAPNCALLPERFSTATSGRID* sgwApn_name=*ims*
                  | eval Attempt = (NumTotalBearersSetupSuccessQci5+NumTotalBearersSetupFailQci5)
                  | eval Success = NumTotalBearersSetupSuccessQci5
                  | eval Reject = NumTotalBearersSetupFailQci5
                  | eval Current = NumCurrentBearersQci5
                  | eval FR = if(isnull((Attempt-Success)/Attempt*100),0,(Attempt-Success)/Attempt*100)
                  | eval FR >=0
                  | eval SR = if(isnull((Attempt-Reject)/Attempt*100),0,(Attempt-Reject)/Attempt*100)
                  | eval SR <=100
                  | timechart span=$span$ avg(FR) as "Failure Rate", avg(SR) as  "Success Rate", avg(Current) as "Current" by sgwApn_name</set>
      </condition>
      <condition value="SGWCALLPERFSTATSGRID">
        <set token="network_context1">index=affirmed host=$pgw$ source=*SGWCALLPERFSTATSGRID* 
                  | eval Attempt = (NumTotalBearersSetupSuccessQci1+NumTotalBearersSetupFailQci1)
                  | eval Success = NumTotalBearersSetupSuccessQci1
                  | eval Reject = NumTotalBearersSetupFailQci1
                  | eval Current = NumCurrentBearersQci1
                  | eval FR = if(isnull((Attempt-Success)/Attempt*100),0,(Attempt-Success)/Attempt*100)
                  | where FR >=0
                  | eval SR = if(isnull((Attempt-Reject)/Attempt*100),0,(Attempt-Reject)/Attempt*100)
                  | where SR <=100
                  | timechart span=$span$ avg(FR) as "Failure Rate", avg(SR) as  "Success Rate", avg(Current) as "Current"  by host</set>
        <set token="network_context2">index=affirmed  source=*SGWCALLPERFSTATSGRID* 
                  | eval Attempt = (NumTotalBearersSetupSuccessQci5+NumTotalBearersSetupFailQci5)
                  | eval Success = NumTotalBearersSetupSuccessQci5
                  | eval Reject = NumTotalBearersSetupFailQci5
                  | eval Current = NumCurrentBearersQci5
                  | eval FR = if(isnull((Attempt-Success)/Attempt*100),0,(Attempt-Success)/Attempt*100)
                  | where FR >=0
                  | eval SR = if(isnull((Attempt-Reject)/Attempt*100),0,(Attempt-Reject)/Attempt*100)
                  | where SR <=100
                  | timechart span=$span$ avg(FR) as "Failure Rate", avg(SR) as  "Success Rate", avg(Current) as "Current" by host</set>
      </condition>

    </change>
  </input>
</panel>


<panel>
  <chart>
    <title>Dedicated QCI1 Bearers(IMS APN) : $network_context$</title>
    <search>
      **<query>$tab_bearers$    $network_context1$</query>**
      <earliest>$time.earliest$</earliest>
      <latest>$time.latest$</latest>
    </search>

  </chart>
</panel>
0 Karma

vikashperiwal
Path Finder

Well .. It was after 3 days i could get a quick and simpe fix to the above problem, i just use set and unset command to hide the panle and get the desired output .. it works now. Thanks

0 Karma

niketn
Legend

@vikashperiwal, you have searchWhenChanged="false" for dropdown pgw. Is that the token which is not working? Set it to "true". Also, some piece of your code did not get posted correctly. Please add four spaces before each line or use the code button (101010 or shortcut Ctrl + K).

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...