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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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