Splunk Search

Transaction using datamodel

rkd
Loves-to-Learn Everything

Hello,

I am trying to calculate the browse time and bandwith usage of users by looking at the log files of the firewall. As far as i can understand the best way to this is to use transaction command.  However, to make the transaction command more efficient, i tried to use it with tstats (which may be completely wrong). my assumption is that if there is more than one log for a source IP to a destination IP for the same time value, it is for the same session. 

Here is my query:

| tstats sum(datamodel.mbyte) as mbyte from datamodel=datamodel by _time source destination
| transaction source destination maxpause=1m

My questions are:

  1. is there a more efficient way to calculate these values?
  2. Max duration value for my query is always equals to maxpause value. Shouldn't be values greater than maxpause. 

Thanks in advance

Labels (2)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

I wonder if you might misunderstand the transaction command.  It merges multiple events based on shared elements.  The tstats command with a by clause does a similar thing so you probably don't need both commands.  Have you tried tstats by itself to see if it produces the desired results?

---
If this reply helps you, Karma would be appreciated.
0 Karma

Kaand
Explorer

Well i may be wrong about transaction, but let me clarify what i need by giving examples. Lets say that i have data as follows:

Event IDTimeSourceDestination
108:00:00S1D1
208:00:45S1D1
308:01:30S1D1
408:02:31S1D1

 

By using transaction i want to group Event ID 1, 2 and 3.  Because, the time difference between consecutive events are less than 1min. Here is my desired output:

Transaction IDSourceDestinationDuration 
1S1D190 
2S1D10 

 

Shouldn't transaction command do that? Am i missing something?

0 Karma
Get Updates on the Splunk Community!

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...