Dashboards & Visualizations

How to address to the selected timerange in a form search?

iKate
Builder

Hi everyone,

My form view (in simplified XML) consists of a main search that uses major timerange from the dropdown (<input type="time" />) and several joined searches that should have another timeranges that should contain either the start date of major timerange or the end date.

I've tried to use in joined searches statements like: ..| join [search source="first" earliest="$search.timeRange.latest$" latest=now..] but it is written that Invalid value "$search.timeRange.earliest$" for time term 'earliest'

How one can address to the selected timerange dates in simple form search?

Thanks in advance

P.S. @nick, I saw your answer on a similar question(http://splunk-base.splunk.com/answers/22708/how-to-pass-on-the-selected-timerange-in-timerangepicker...), maybe you would be able to help also with this case? I would appreciate it greatly

Tags (2)
0 Karma

woodcock
Esteemed Legend

You might also make use of addinfo but I think this example will show you all you need:

<form>
  <label>Different Times inside Search</label>
  <description>Answers.Splunk.com</description>
  <fieldset autoRun="true" submitButton="false">
    <input type="time" token="time_tok1" searchWhenChanged="true">
      <label>Chart Timespan/Width</label>
      <default>Yesterday</default>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <title>Example of different time token uses</title>
        <search>
          <query>index=* | stats earliest(_time) latest(_time)
            | append [search earliest=-2d@d index=* latest=$time_tok1.latest$ | stats earliest(_time) latest(_time)]
            | append [search earliest=$time_tok1.earliest$ latest=now() index=* | stats earliest(_time) latest(_time)]</query>
          <earliest>$time_tok1.earliest$</earliest>
          <latest>$time_tok1.latest$</latest>
        </search>
        <option name="list.drilldown">full</option>
        <option name="list.wrap">1</option>
        <option name="maxLines">5</option>
        <option name="raw.drilldown">full</option>
        <option name="rowNumbers">false</option>
        <option name="table.drilldown">all</option>
        <option name="table.wrap">1</option>
        <option name="type">list</option>
        <option name="wrap">true</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</option>
        <option name="count">100</option>
      </table>
    </panel>
  </row>
</form>
0 Karma
Get Updates on the Splunk Community!

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

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...