Splunk Search

Why is the relative_time not converting +24y? Is there a limitation in the function?

vasanthmss
Motivator

Hi Splunkers,

Why the relative_time function is not converting +24y? any reason? Any way to achieve this?

|stats count | eval next_time=relative_time(now(),"+24y") 

Is there any limitation in relative_time function?

Cheers!!!

V
1 Solution

acharlieh
Influencer

It seems that relative_time (at least on 6.2.0) is limited by the Year 2038 problem: http://en.wikipedia.org/wiki/Year_2038_problem

Check this out, this works:

noop | stats count | eval _time=relative_time(now(),"+24y@y+18d+3h+14m+7s")

But this doesn't:

noop | stats count | eval _time=relative_time(now(),"+24y@y+18d+3h+14m+8s")

But this does:

noop | stats count | eval _time=relative_time(now(),"+24y@y+18d+3h+14m+7s")+1

View solution in original post

cabauah
Path Finder

is there an update on this issue? what's an alternative solution?

0 Karma

cabauah
Path Finder

we've fixed the issue by using good ol strptime and strftime

acharlieh
Influencer

It seems that relative_time (at least on 6.2.0) is limited by the Year 2038 problem: http://en.wikipedia.org/wiki/Year_2038_problem

Check this out, this works:

noop | stats count | eval _time=relative_time(now(),"+24y@y+18d+3h+14m+7s")

But this doesn't:

noop | stats count | eval _time=relative_time(now(),"+24y@y+18d+3h+14m+8s")

But this does:

noop | stats count | eval _time=relative_time(now(),"+24y@y+18d+3h+14m+7s")+1

acharlieh
Influencer

For those following along at home... as it's still a problem, I logged Case 468033 for this.

0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...