Splunk Enterprise Security

Find difference in days between today and another date

yvassilyeva
Path Finder

Hi,

I have a creation_date field that has date format 2019-06-21 10:18:00 and then i created a field for today's date  | eval nowstring=now() that has the format 1623929734. Now I am trying to find the different between to dates in days. Your advice is appreciated, thank you.

Labels (1)
0 Karma
1 Solution

rrovers
Communicator

something like this:

| makeresults
| eval date=strptime("2019-06-21 10:18:00","%Y-%m-%d %H:%M:%S")
| eval nowstring=now()
| eval verschil=(nowstring-date)/86400

View solution in original post

rrovers
Communicator

something like this:

| makeresults
| eval date=strptime("2019-06-21 10:18:00","%Y-%m-%d %H:%M:%S")
| eval nowstring=now()
| eval verschil=(nowstring-date)/86400

yvassilyeva
Path Finder

Awesome, thank you. I forgot the last line.

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 ...