Getting Data In

Time modifiers for splunk dashboard - using base search

Poojitha
Path Finder

Hi All,

I am using base search , I want to use time picker(earliest and latest) in other panel which is using this base search.

How can I achieve that ?

Reference query :

 

 

<form version="1.1" theme="dark">
  <label>Test Dashboard</label>
  <description>Dashboard created for testing purpose</description>
  <search id="base_12">
    <query>
      index=test_index
    </query>
    <earliest>0</earliest>
    <latest></latest>
  </search>
  <fieldset submitButton="true" autoRun="true">
    <input type="time" token="time">
      <label>Time Picker</label>
      <default>
        <earliest>-7d@w0</earliest>
        <latest>@w0</latest>
      </default>
    </input>
<search base="base_12">
        <query>| search (($app$) AND ($environment$))| stats count by test
| fields test</query>
      </search>

 

 


Regards,
NVP

Labels (2)
Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Poojitha,

you code is incomplete but it isn't a problem.

You have to add the time token in the base search, I usually create a complete search in a panel (also with time token) and then I move all the search in the base search so I already have the time token configure, anyway, please try this:

<form version="1.1" theme="dark">
  <label>Test Dashboard</label>
  <description>Dashboard created for testing purpose</description>
  <search id="base_12">
    <query>
      index=test_index
    </query>
    <earliest>$time.earliest$</earliest>
    <latest>$time.latest$</latest>
  </search>
  <fieldset submitButton="true" autoRun="true">
    <input type="time" token="time">
      <label>Time Picker</label>
      <default>
        <earliest>-7d@w0</earliest>
        <latest>@w0</latest>
      </default>
    </input>
<search base="base_12">
        <query>| search (($app$) AND ($environment$))| stats count by test
| fields test</query>
      </search>

remember, when you don't use a streaming command as stats or timechart, to add, at the end of the base search, the fields command with all the fields you need to use in your dashboard panels.

Ciao.

Giuseppe

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