I need to find the duration between two events. I went over the solutions on splunk and Stack Overflow, but still can't get the calculation.
Both sentToSave
and SaveDoc
have the time stamp already formatted, which is why I used the case function. I am able to see the fields populate with their time stamps, but I am not able to get the Duration
field to populate the duration - it simply does not populate at all.
Need some help on how to get the Duration
- any advice? Here is my search:
(index=souce1 dept=qvc event="sentToSave") OR (index=source dept=save area=saveDoc)
| eval saveDocTime=case(area="saveDoc", TimeStamp), sentToSaveTime=case(event="sentToSave", TimeStamp)
| eval Duration=saveDocTime-sentToSaveTime
| stats values(Duration) as Duration earliest(sentToSaveTime) as sentToSaveTime latest(saveDocTime) as saveDocTime by emailRequest
| where isNotNull(sentToSaveTime) AND isNotNull(saveDocTime)