Dashboards & Visualizations

I want to pass a time value with workflow action and calculate a range in the dashboard.

andygerber
Path Finder

I am trying to pass a time value using a workflow action, and then use init in the dashboard to create a new time range for the search. What happens is the URL is re-written as the dashboard runs with values for my time picker that are wrong.

In the URL, I pass a value "base_time" which is the ending time of the event I'm interested in. I want the dashboard to run its searches 24 hours prior to the base and 4 hours after. So I init the values of the time picker, which is token=field2 as well as make some easy to read versions of tthe time.

 <form>
  <init>
    <eval token="form.field2.earliest">$base_time$ - 86400</eval>
    <eval token="form.field2.latest">$base_time$ + 14400</eval>
    <eval token="base_time_str">strftime($base_time$, "%m/%d/%Y %H:%M:%S")</eval>
    <eval token="earliest_str">strftime($form.field2.earliest$, "%m/%d/%Y %H:%M:%S")</eval>
    <eval token="latest_str">strftime($form.field2.latest$, "%m/%d/%Y %H:%M:%S")</eval>
 </init>

Later in the dashboard is the time picker:

    <input type="time" token="field2">
      <label></label>
  <default>
        <earliest>$form.field2.earliest$</earliest>
        <latest>$form.field2.latest$</latest>
      </default>
    </input>

It doesn't work; what seems to happen is the URL gets re-written with the variable names, not the actual time values.

If this is important, it's being called from a Enterprise Security notable event.

Get Updates on the Splunk Community!

Splunk Observability Cloud | Unified Identity - Now Available for Existing Splunk ...

Raise your hand if you’ve already forgotten your username or password when logging into an account. (We can’t ...

Index This | How many sides does a circle have?

February 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

Registration for Splunk University is Now Open!

Are you ready for an adventure in learning?   Brace yourselves because Splunk University is back, and it's ...