Getting Data In

Time Input - How to Add to Only 1 Panel, Not Every Panel

mistydennis
Communicator

I have a form with multiple panels, each panel using different inputs/tokens. Only one panel requires a time input, the other panels are not based on time. When I change the time input of this one panel, all the other panels refresh, but I would like for them to ignore the time change. Is this possible?

0 Karma
1 Solution

somesoni2
Revered Legend

When you open the panels in the edit mode, you can specify which time range picker you're using. It seems all dashboard panels are using your single available time-range picker. Just edit those panels to use explicit selection with some hard-coded values, say last 15 mins. (as those panels don't depend upon time range picker).

See Step 6 from this link for reference: https://docs.splunk.com/Documentation/Splunk/7.0.1/SearchTutorial/Createnewdashboard#Add_controls_to...

View solution in original post

NeerajDhapola7
Path Finder

You can have local time picker for that panel only
Make sure time's token should be unique

<panel>
  <title>This is Titel here</title>
     <input type="time" token="time_tok">
      <label>Time</label>
      <default>
        <earliest>-3h@h</earliest>
        <latest>now</latest>
      </default>
    </input>

  <chart>
    <search>
      <query>******QUERY********</query>
      <earliest>$time_tok.earliest$</earliest>
      <latest>$time_tok.latest$</latest>
      <sampleRatio>1</sampleRatio>
      <refresh>10m</refresh>
      <refreshType>delay</refreshType>
    </search>
0 Karma

somesoni2
Revered Legend

When you open the panels in the edit mode, you can specify which time range picker you're using. It seems all dashboard panels are using your single available time-range picker. Just edit those panels to use explicit selection with some hard-coded values, say last 15 mins. (as those panels don't depend upon time range picker).

See Step 6 from this link for reference: https://docs.splunk.com/Documentation/Splunk/7.0.1/SearchTutorial/Createnewdashboard#Add_controls_to...

View solution in original post

mistydennis
Communicator

Thanks for pointing me to that page, somesoni2!

0 Karma

493669
Super Champion

yes it is possible! can you share your xml code

0 Karma

mistydennis
Communicator

So. Much. Code.

The only panel where a time input is needed is the one titled "Publication Downloads". All other panels should be independent of this time input.

0 Karma

mistydennis
Communicator
<form>
  <label>Authors</label>
  <description>Shows reporting on a specific author.</description>
  <search id="BaseSearch">
    <query>| inputlookup phad 
| search `reportable_status` 
| search ((PublicationDate1&gt;=2012-10-01 PublicationDate1&lt;=2018-09-30) OR (PublishedElectronicallyDate1&gt;=2012-10-01 PublishedElectronicallyDate1&lt;=2018-09-30)) 
| eval PubType2=if(PeerReviewedJournal="Yes" AND PublicationType="JA Journal Article", "JA Journal Article (Peer Reviewed)", PublicationType) 
| eval PubType2=if(PubType2="JA Journal Article", "JA Journal Article (Other)", PubType2) 
| eval newpubdate=coalesce(PublishedElectronicallyDate1, PublicationDate1) 
| eval newpubdate=substr(newpubdate, 1, len(newpubdate)-3) 
| `FY13-FY18_pubtype_count` </query>
  </search>
  <fieldset submitButton="true" autoRun="false">
    <input type="dropdown" token="fy_token" searchWhenChanged="true">
      <label>Fiscal Year</label>
      <default>FY18</default>
      <fieldForLabel>newpubdate</fieldForLabel>
      <fieldForValue>newpubdate</fieldForValue>
      <search>
        <query>| inputlookup phad | `fy13-18_token`</query>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </search>
      <choice value="*">FY13-18</choice>
    </input>
    <input type="text" token="author_tok" searchWhenChanged="true">
      <label>Author (Last Name, First Initial)</label>
      <default>*</default>
      <prefix>"*</prefix>
      <suffix>*"</suffix>
    </input>
  </fieldset>
  <row>
    <panel>
      <title>Author Publication Details ($fy_token$)</title>
      <table>
        <search base="BaseSearch">
          <query>| search Author=$author_tok$ newpubdate=$fy_token$ `reportable_status` 
| table `metrics_basic` 
| sort -"First Online Date"</query>
        </search>
        <option name="drilldown">none</option>
        <option name="wrap">false</option>
        <format type="color" field="Impact Factor">
          <colorPalette type="minMidMax" maxColor="#31A35F" minColor="#E5F4EB"></colorPalette>
          <scale type="minMidMax"></scale>
        </format>
      </table>
    </panel>
  </row>
  <row>
    <panel>
      <title>Author Publication Types</title>
      <table>
        <title>Author=$author_tok$</title>
        <search base="BaseSearch">
          <query>| search Author=$author_tok$  `reportable_status` 
| search ((PublicationDate1&gt;=2012-10-01 PublicationDate1&lt;=2018-09-30) OR (PublishedElectronicallyDate1&gt;=2012-10-01 PublishedElectronicallyDate1&lt;=2018-09-30)) 
| eval PubType2=if(PeerReviewedJournal="Yes" AND PublicationType="JA Journal Article", "JA Journal Article (Peer Reviewed)", PublicationType) 
| eval PubType2=if(PubType2="JA Journal Article", "JA Journal Article (Other)", PubType2) 
| eval newpubdate=coalesce(PublishedElectronicallyDate1, PublicationDate1) 
| eval newpubdate=substr(newpubdate, 1, len(newpubdate)-3) 
| `FY13-FY18_pubtype_count`
| chart count by PubType2, newpubdate 
| rename PubType2 AS "Publication Type"
| fields - NULL
| addtotals 
| addcoltotals label="Fiscal Year Totals" labelfield="Publication Type"</query>
        </search>
        <option name="count">20</option>
        <option name="drilldown">none</option>
      </table>
    </panel>
    <panel>
      <title>Publication Downloads</title>
      <input type="text" token="pubid_tok" searchWhenChanged="true">
        <label>Publication Number</label>
      </input>
      <input type="time" searchWhenChanged="true">
        <label>Time Range</label>
        <default>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </default>
      </input>
      <table>
        <title>Shows download counts for specific publications.</title>
        <search>
          <query>PublicationId=$pubid_tok$ response_code=200 
| `nobots`
| `iplocation` 
| bin _time span=1h 
| stats count, dc(src_ip) as DistinctIP, dc(PublicationId) as "Unique Visits" by PublicationId, agentType, IPLocation, _time, src_ip 
| stats count AS Downloads by IPLocation 
| addcoltotals labelfield=IPLocation label="TOTALS"</query>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
  <row>
    <panel>
      <title>Top 25 Collaborators</title>
      <input type="dropdown" token="fy_token_collab" searchWhenChanged="true">
        <label>Fiscal Year</label>
        <default>FY18</default>
        <fieldForLabel>newpubdate</fieldForLabel>
        <fieldForValue>newpubdate</fieldForValue>
        <search>
          <query>| inputlookup phad | `fy13-18_token`</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <choice value="*">FY13-18</choice>
      </input>
      <table>
        <title>Shows publications where $author_tok$ collaborated with an outside institution.</title>
        <search base="BaseSearch">
          <query>| search newpubdate=$fy_token_collab$ Author=$author_tok$ CorporateAuthor=* `reportable_status` 
| table  CorporateAuthor 
| eval Collaborator=split(CorporateAuthor,";") 
| eval Collaborator=trim(Collaborator)
| mvexpand Collaborator limit=0
| search NOT Collaborator="et al."
| stats count(Collaborator) by Collaborator
| sort -count(Collaborator)
| rename  count(Collaborator) AS "Collaboration Count"
| head 25</query>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
    <panel>
      <title>Center Collaborations</title>
      <input type="dropdown" token="fy_tok" searchWhenChanged="true">
        <label>Fiscal Year</label>
        <choice value="*">FY16-18</choice>
        <fieldForLabel>newpubdate</fieldForLabel>
        <fieldForValue>newpubdate</fieldForValue>
        <search>
          <query>| inputlookup phad | `fy_token`</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <default>FY18</default>
      </input>
      <chart>
        <title>$author_tok$, $fy_tok$</title>
        <search base="BaseSearch">
          <query>| search Author=$author_tok$ newpubdate=$fy_tok$ SecondaryNRELCenters=* `reportable_status` 
| table SecondaryNRELCenters 
| eval CenterCollab=split(SecondaryNRELCenters,";") 
| eval CenterCollab=trim(CenterCollab)
| mvexpand CenterCollab limit=0
| stats count(CenterCollab) by CenterCollab
| sort -count(CenterCollab)
| rename count(CenterCollab) AS Publications</query>
        </search>
        <option name="charting.axisLabelsY.majorUnit">2</option>
        <option name="charting.axisTitleX.visibility">collapsed</option>
        <option name="charting.chart">column</option>
        <option name="charting.chart.showDataLabels">all</option>
        <option name="charting.chart.stackMode">stacked</option>
        <option name="charting.drilldown">none</option>
        <option name="charting.layout.splitSeries">0</option>
      </chart>
    </panel>
  </row>
  <row>
    <panel>
      <title>Lead Author Publication Compliance</title>
      <input type="dropdown" token="la_email_fy_tok" searchWhenChanged="true">
        <label>Fiscal Year</label>
        <default>FY18</default>
        <fieldForLabel>newpubdate</fieldForLabel>
        <fieldForValue>newpubdate</fieldForValue>
        <search>
          <query>| inputlookup phad | `fy_token`</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
      </input>
      <input type="dropdown" token="la_email_tok" searchWhenChanged="true">
        <label>Lead Author Email</label>
        <fieldForLabel>LeadNRELAuthorsEmail</fieldForLabel>
        <fieldForValue>LeadNRELAuthorsEmail</fieldForValue>
        <search>
          <query>| inputlookup phad 
| search PublishedElectronicallyDate1&gt;=2015-10-01 PublishedElectronicallyDate1&lt;=2018-09-30 `reportable_status`
| table LeadNRELAuthorsEmail 
| dedup LeadNRELAuthorsEmail  
| sort LeadNRELAuthorsEmail</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
      </input>
      <chart>
        <title>$la_email_fy_tok$, $la_email_tok$</title>
        <search base="BaseSearch">
          <query>| search `reportable_status` newpubdate=$la_email_fy_tok$ LeadNRELAuthorsEmail=$la_email_tok$
| eval newpubdate=coalesce(PublishedElectronicallyDate1, PublicationDate1) 
| eval newpubdate=substr(newpubdate, 1, len(newpubdate)-3) 
| chart count by LeadNRELAuthorsEmail, WasThisDocumentPublishedWithoutApprovalIs 
| rename No AS "Compliant", Yes AS "Non-Compliant", LeadNRELAuthorsEmail AS "Lead Author"</query>
        </search>
        <option name="charting.axisLabelsY.majorUnit">2</option>
        <option name="charting.axisTitleX.visibility">collapsed</option>
        <option name="charting.axisTitleY.text">Publications</option>
        <option name="charting.chart">column</option>
        <option name="charting.chart.showDataLabels">all</option>
        <option name="charting.drilldown">none</option>
        <option name="charting.fieldColors">{"Non-Compliant":0xFB8B25, "Compliant":0x009900}</option>
      </chart>
    </panel>
    <panel>
      <title>Accepted Manuscripts - Shows AMs Received vs. AMs Not Received. Based on Lead Author</title>
      <chart>
        <title>$la_email_fy_tok$, $la_email_tok$</title>
        <search base="BaseSearch">
          <query>|search newpubdate=$la_email_fy_tok$ LeadNRELAuthorsEmail=$la_email_tok$
| eval AMStatus=if(isnull(AcceptedManuscripts), "AM Not Received", "AM Received") 
| stats count by AMStatus 
| rename count as "Total"</query>
        </search>
        <option name="charting.chart">pie</option>
        <option name="charting.drilldown">none</option>
        <option name="charting.fieldColors">{"AM Not Received":0xFB8B25, "AM Received":0x009900}</option>
      </chart>
    </panel>
  </row>
</form>
0 Karma
Did you miss .conf21 Virtual?

Good news! The event's keynotes and many of its breakout sessions are now available online, and still totally FREE!