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.

0 Karma
1 Solution

rrovers
Contributor

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
Contributor

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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.


Introducing Unified TDIR with the New Enterprise Security 8.2

Read the blog

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...