Dashboards & Visualizations

Unable to pass the correct timevalue for drilldown

sushmitha_mj
Communicator

I am passing the timevalue and hostname from table 1 in panel1 to another query/panel in the same dashboard 

Here is a sample time format : 2021-02-14 19:04:34

I first had the time as column 2 and tries all combinations of eval

<eval token>="e">strptime($click.value2$,"%Y-%m-%d %H:%M:%S.%3N")</eval>

<eval token="l">strptime($row._time$,"%Y-%m-%d %H:%M:%S.%3N")+1200</eval>

When I printed $e$ and $l$ said NaN

Then I made it column 1 and used this combination of eval 

<eval token>="e">$click.value$-600</eval>
<eval token>="l">relative_time($click.value$,"+5m")</eval>

When I printed $e$ it said 1421 and $l$ said NaN

Ideas? 

 

Labels (2)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

I seems to recall that $row._time$ is fiddly and I can't remember how to process it in tokens, but this is a simple solution that calculates the future time in the first result set, but just doesn't display it and then just use the value in the drilldown

<dashboard>
  <label>Time</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults
          | eval x=1
          | eval f=_time+1200
| table _time x f</query>
          <earliest>-15m@m</earliest>
          <latest>@m</latest>
        </search>
        <option name="drilldown">row</option>
        <option name="refresh.display">progressbar</option>
        <fields>_time, x</fields>
        <drilldown>
          <set token="f">$row.f$</set>
        </drilldown>
      </table>
    </panel>
    <panel>
      <table>
        <search>
          <query>
            | makeresults
            | eval f=$f$
            | eval ft=strftime(f, "%F %T")
            | table f ft
          </query>
        </search>
      </table>
    </panel>
  </row>
</dashboard>

Hope this helps

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

I seems to recall that $row._time$ is fiddly and I can't remember how to process it in tokens, but this is a simple solution that calculates the future time in the first result set, but just doesn't display it and then just use the value in the drilldown

<dashboard>
  <label>Time</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults
          | eval x=1
          | eval f=_time+1200
| table _time x f</query>
          <earliest>-15m@m</earliest>
          <latest>@m</latest>
        </search>
        <option name="drilldown">row</option>
        <option name="refresh.display">progressbar</option>
        <fields>_time, x</fields>
        <drilldown>
          <set token="f">$row.f$</set>
        </drilldown>
      </table>
    </panel>
    <panel>
      <table>
        <search>
          <query>
            | makeresults
            | eval f=$f$
            | eval ft=strftime(f, "%F %T")
            | table f ft
          </query>
        </search>
      </table>
    </panel>
  </row>
</dashboard>

Hope this helps

Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...