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!

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

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...