Hi Experts,
I am trying to get number of days between current date and another date being generated by my query and I am using the below code to calculate the same but i am getting blank results.
| rex field=current "(?P\d{4}-\d{2}-\d{2})" -->date value fetched from field named "current". output for "date" field is 2018-09-01
| eval days = round((now()-date)/86400,0)
| table days.
Please suggest where I am wrong.
Hi
Try this
| makeresults
| eval date="2018-09-01"
| eval dateDue=strptime(date, "%Y-%m-%d")
| eval days = round((now()-dateDue)/86400)
Hi
Try this
| makeresults
| eval date="2018-09-01"
| eval dateDue=strptime(date, "%Y-%m-%d")
| eval days = round((now()-dateDue)/86400)
Thanks..working perfectly fine..
I have been working on something similar and was a about to ask a question to the group until I found this answer. It solved one of the missing puzzle pieces for me. Thank you!