Dashboards & Visualizations

Dashboard with different time tokens (today and -7days)

auaave
Communicator

Hi guys,

I have a daily report dashboard with the below token. However, I need to create another report on the same dashboard with trend for the last - 7 days.

How do I create a new token for the last 7 days?

If "today" is selected on the time picker, It should search for - 7 days from today?
If "yesterday" is selected on the time picker, It should search for - 7 days from yesterday?

<input type="time" token="time" searchWhenChanged="true">
      <label>Time</label>
      <default>
        <earliest>@d</earliest>
        <latest>now</latest>
      </default>
      <change>
        <eval token="time.earliest_epoch">if('earliest'="",0,if(isnum('earliest'),'earliest',relative_time(now(),'earliest')))</eval>
        <eval token="time.latest_epoch">if(isnum('latest'),'latest',relative_time(now(),'latest'))</eval>
        </change>
    </input>

Thank you!

0 Karma
Get Updates on the Splunk Community!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...