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!

2024 Splunk Career Impact Survey | Earn a $20 gift card for participating!

Hear ye, hear ye! The time has come again for Splunk's annual Career Impact Survey!  We need your help by ...

Optimize Cloud Monitoring

  TECH TALKS Optimize Cloud Monitoring Tuesday, August 13, 2024  |  11:00AM–12:00PM PST   Register to ...

What's New in Splunk Cloud Platform 9.2.2403?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.2.2403! Analysts can ...