Splunk Search

Adding time in a search

sptelars
New Member

I would like to add the total amount of time an cs_id spends on the web daily. Ironport provides logs where the time is in unix time, does anyone know of a way to do this?

Tags (2)
0 Karma

gkanapathy
Splunk Employee
Splunk Employee

If the time is simply the number of seconds (or whatever), you could just do:

cs_id=myid | stats sum(timespent) by cs_id

But by "unix time" I guess you mean epoch time? If that's the case, I assume they must be providing a start and end time for each session, so you need to compute the duration from the difference:

cs_id=myid | eval duration = endtime-starttime | stats sum(duration) by cs_id

I really have no idea how the above information is actually represented in your logs, so it might not work (e.g., maybe the data in different events, and you have to use transaction to construct the sessions and start and durations yourself, I don't know.

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...