Getting Data In

How to use time input in another input search

matansocher
Contributor

Hi

I have a dashboard with 2 input - time and another field ('fieldA').
'fieldA' is populated by a search, and it has his own time.
How do I use the time input to the search that populates 'fieldA'?

thanks

1 Solution

tiagofbmm
Influencer

If you have a TimePicker input, you can use its token and pass it to your other input search. Check my example below:

<form>
  <label>Time</label>
  <fieldset submitButton="false">
    <input type="time" token="timepicker">
      <label></label>
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
    </input>
    <input type="dropdown" token="src">
      <label>Sources</label>
      <fieldForLabel>source</fieldForLabel>
      <fieldForValue>source</fieldForValue>
      <search>
        <query>| tstats count where index=_internal by source</query>
        <earliest>$timepicker.earliest$</earliest>
        <latest>$timepicker.latest$</latest>
      </search>
    </input>
  </fieldset>
</form>

View solution in original post

tiagofbmm
Influencer

If you have a TimePicker input, you can use its token and pass it to your other input search. Check my example below:

<form>
  <label>Time</label>
  <fieldset submitButton="false">
    <input type="time" token="timepicker">
      <label></label>
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
    </input>
    <input type="dropdown" token="src">
      <label>Sources</label>
      <fieldForLabel>source</fieldForLabel>
      <fieldForValue>source</fieldForValue>
      <search>
        <query>| tstats count where index=_internal by source</query>
        <earliest>$timepicker.earliest$</earliest>
        <latest>$timepicker.latest$</latest>
      </search>
    </input>
  </fieldset>
</form>
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 ...