Dashboards & Visualizations

Drilldown with other timestamp not working

splunk_hvijay
Explorer

My drilldown with timestamp is not working.

Date Value
2017-09-01 1
2017-09-02 2
2017-09-03 4

I need to drilldown the date and pass earliest=date and latest=earliest+86400..(passing 24 hours).

below is the code i'm using,

<eval token="e">'row.Date' + 1800</eval>
<link target="_blank">
              <![CDATA[/app/myapp?&form.timetoken1.earliest=$click.value$&form.timetoken1.latest=$e$
                ]]>
            </link>
0 Karma
1 Solution

niketn
Legend

You seem to be picking Date value from Table. Since it is human readable string date, you need to convert to epoch time using strptime() first. Try the following code which uses eval to convert/calculates earliest and latest time as epoch time and passes to the drilldown URL:

    <drilldown>
      <condition field="Date">
        <eval token="tokEarliest">strptime($row.Date$,"%Y-%m-%d")</eval>
        <eval token="tokLatest">strptime($row.Date$,"%Y-%m-%d")+86400</eval>
        <link target="_blank">/app/<YourAppName>/<YourFormName>?form.timetoken1.earliest=$tokEarliest$&amp;form.timetoken1.latest=$tokLatest$</link>            
      </condition>  
    </drilldown>

PS: Add your app name and dashboard name in the link above.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

You seem to be picking Date value from Table. Since it is human readable string date, you need to convert to epoch time using strptime() first. Try the following code which uses eval to convert/calculates earliest and latest time as epoch time and passes to the drilldown URL:

    <drilldown>
      <condition field="Date">
        <eval token="tokEarliest">strptime($row.Date$,"%Y-%m-%d")</eval>
        <eval token="tokLatest">strptime($row.Date$,"%Y-%m-%d")+86400</eval>
        <link target="_blank">/app/<YourAppName>/<YourFormName>?form.timetoken1.earliest=$tokEarliest$&amp;form.timetoken1.latest=$tokLatest$</link>            
      </condition>  
    </drilldown>

PS: Add your app name and dashboard name in the link above.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

splunk_hvijay
Explorer

thanks a ton !!.. It worked.

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...