Splunk Search

Map earliest/latest no longer working since update to 7.1.0

koenV
Explorer

Our Splunk instance has recently (yesterday?) been updated to 7.1.0 from 7.0.0.
My queries were working perfectly before but now the map function returns the following error:

Invalid value "$TimeEarliest" for time term 'earliest'

The value is in the correct format as specified here. (i.e. %m/%d/%Y:%H:%M:%S) When I copy the actual values from the table (before I apply the map function) and put them in place of the $TimeEarliest$ and $TimeLatest$ it works perfectly.

Hence, I think something is wrong with parsing a time variable to/in the map function.
The search is as follows:

search sourcetype IN (list of sourcetypes) $Id1$ OR $Id2$ earliest=$TimeEarliest$ latest=$TimeLatest$

I have confirmed/double checked that all 4 variables are set and are in the correct format (in case of the time variables).
I also cannot find anything about this issue here nor here. (known issues and "Update to 7.1.0 read this first"). Nor anywhere on Splunk Answers either.

Anyone knows what's going wrong?

1 Solution

koenV
Explorer

If anyone has this problem, the following solved it for me:

Instead of using "earliest" and "latest" in the search I now simply use:

_time>= "$TimeEarliest$" OR _time<="$TimeLatest$"

This seems to have fixed the issue. I am not sure whether it affects the performance of the query, but since it is already a large/slow query it doesn't really matter for me.

View solution in original post

0 Karma

koenV
Explorer

If anyone has this problem, the following solved it for me:

Instead of using "earliest" and "latest" in the search I now simply use:

_time>= "$TimeEarliest$" OR _time<="$TimeLatest$"

This seems to have fixed the issue. I am not sure whether it affects the performance of the query, but since it is already a large/slow query it doesn't really matter for me.

0 Karma

DalJeanis
Legend

Interesting. Haven't heard this.

1) Check the job inspector and see what was input into the search itself.

2) try putting properly-escaped quotes around the TimeEarliest and TImeLatest variables.

("Properly escaped" is going to depend whether you are in a dash, a saved search, etc.)

0 Karma

koenV
Explorer

Hi @DalJeanis thanks for you reply!

I've found a workaround: using _time>= "$TimeEarliest$" OR _time<="$TimeLatest$"

0 Karma

koenV
Explorer

Bump?......

0 Karma

koenV
Explorer

Help please 😞

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...