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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...