Splunk Search

What is the proper syntax for the shared time picker token in my search string?

Makinde
New Member

I am currently ingesting my vulnerability scan reports into Splunk, but we receive more results than scanned as there are other details that get reported. However, there is a Last_Scan_Datetime Field that seems to be the best way to identify only results from the scan and not the other information.

I have a dashboard with Time input and lots of panels on the results of the vulnerability scan. I would like this Last_Scan_Datetime information to pre-populate based on the information selected in the Time input. How can I do this?

Currently I tried doing this;

index=main sourcetype=vulnerability_scans Last_Scan_Datetime=$TRPicker$ (TRPicker is the name of the Time Picker) 

but this doesn't seem to work. However, the same syntax would work assuming it was a text box. What is the syntax for the Time Picker?

0 Karma
1 Solution

sundareshr
Legend

There are couple of factors in play here

1) The token value returned by time picker is usually a relative value (-7d) depending on user selection. To overcome that, you could use $token_name.earliest$.

2) $token_name.earliest$ returns time in epoch format. So unless the time format in your field is epoch, you will have to convert it to epoch.

http://docs.splunk.com/Documentation/Splunk/6.4.1/Viz/tokens#Define_tokens_for_time_inputs

View solution in original post

sundareshr
Legend

There are couple of factors in play here

1) The token value returned by time picker is usually a relative value (-7d) depending on user selection. To overcome that, you could use $token_name.earliest$.

2) $token_name.earliest$ returns time in epoch format. So unless the time format in your field is epoch, you will have to convert it to epoch.

http://docs.splunk.com/Documentation/Splunk/6.4.1/Viz/tokens#Define_tokens_for_time_inputs

Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...