Dashboards & Visualizations

Handling dashboard parameters passed in from link

mschellhouse
Path Finder

We have a dashboard panel table that contains links to dashboard "snapshots" like this:
http://...?form.field1.earliest=1505343600&form.field1.latest=1505354400

On the dashboard we have a panel that has external hyperlinks which need dynamic timestamps as well. In order to create those timestamps we have the following code in the form section of our dashboard:

<input type="time" token="field1">
  <label></label>
  <default>
    <earliest>-1d@d</earliest>
    <latest>@d</latest>
  </default>
  <change>
     <condition match="isnum($earliest$) OR isnum($latest$)">
       <eval token="stime">strftime('earliest',"%m/%d/%y %H:%M:%S"</eval>
       <eval token="etime">strftime('latest',"%m/%d/%y %H:%M:%S"</eval>
       <eval token="etime_NR">'latest'+3600</eval>
      <eval token="duration_NR">$latest$-$earliest$+7200</eval>
     </condition>
  </change>
</input>

This code works fine if I am coming into the dashboard directly and use the date picker to select earliest/latest. If I come to the dashboard via a link like above, the variables stime/etime/etime_NR/duration_NR are not set. Ideas?

0 Karma
1 Solution

mschellhouse
Path Finder

So I am going to answer my own question. This is probably bad etiquette on Splunk Answers. Willing to handle correctly if someone points out how I should do that...

The problem is with my defaults on the form for earliest/latest. They are conflicting with what is passed on the URL. Removing those defaults seems to allow everything to flow through as expected.

View solution in original post

0 Karma

mschellhouse
Path Finder

So I am going to answer my own question. This is probably bad etiquette on Splunk Answers. Willing to handle correctly if someone points out how I should do that...

The problem is with my defaults on the form for earliest/latest. They are conflicting with what is passed on the URL. Removing those defaults seems to allow everything to flow through as expected.

0 Karma

lfedak_splunk
Splunk Employee
Splunk Employee

Hey @mschellhouse, If you have a question, share it with the community, then find a solution, then you should accept your own answer. 🙂 There will be more info as this is edited over time, but you can always reference the Answers documentation as well if you have questions about etiquette. http://docs.splunk.com/Documentation/Community/latest/community/AboutCommunity Happy Splunking!

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...