Splunk Search

Eval Statement for today plus 7 days?

daniel333
Builder

All,

Quick one I am stuck on. I want an EVAL statement that takes _indexedtime and adds 7 days to it and creates a field that is human readable.

EVAL-sevendaysfromnow = now() + 7d@d?

0 Karma
1 Solution

mayurr98
Super Champion

Try this:

For every event as per indextime

.. | eval time=strftime(_indextime+604800,"%Y-%m-%d %H:%M:%S")

with this you will get one value that will be always be now + 7 days

..| eval time=strftime(now()+604800,"%Y-%m-%d %H:%M:%S")

View solution in original post

0 Karma

mayurr98
Super Champion

Try this:

For every event as per indextime

.. | eval time=strftime(_indextime+604800,"%Y-%m-%d %H:%M:%S")

with this you will get one value that will be always be now + 7 days

..| eval time=strftime(now()+604800,"%Y-%m-%d %H:%M:%S")

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...