Getting Data In

Help on an input time token

jip31
Motivator

Hello

I use an input time token called "timepicker"

<earliest>$timepicker.earliest$</earliest>
        <latest>$timepicker.latest$</latest>

 Is there a way to call this input time token directly in my search ?

Someting like this :

Index=toto sourcetype=tutu earliest=$timepicker$ latest=$timepicker$ 

Thanks 

 

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

If you have to use two different time windows then you'll need two base searches.

If you really want to use a single base search then you'll have to use only one time window.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

jip31
Motivator

Is anybody can help please?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Reference the tokens in the search the same way they are referenced the Simple XML.

---
If this reply helps you, Karma would be appreciated.
0 Karma

jip31
Motivator

right, it works

earliest=$timesource.earliest$ latest=$timesource.latest$

But is it possible to add this token somewhere else than just after the index and the sourcetype?

for example, this doesnt works

| search earliest=$timesource.earliest$ latest=$timesource.latest$
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Please explain what you mean by "this doesnt works".  What results do you get compared to what you expect?

Depending on what is in your query prior to the search command, you may be running into the known limitation described at https://docs.splunk.com/Documentation/Splunk/8.2.4/SearchReference/Search#Using_the_search_command_l....

---
If this reply helps you, Karma would be appreciated.
0 Karma

jip31
Motivator

In my dashboard i use 2 input time tokens

I also use 2 base search in order to display data in 2 table panels

These 2 table panels refer to the 2 input time token 

As the search are the same i want to use just one base search instead two

Actually i use 2 base search due to the 2 différents input time token

The problem is that in my base search i cant refer to 2 différent input time token

So i search a way to use just one base search with 2 input time tokens...

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If you have to use two different time windows then you'll need two base searches.

If you really want to use a single base search then you'll have to use only one time window.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...