Splunk Search

What is the difference between maxspan and timelimit?

kimmyb
Loves-to-Learn

 the transaction is identified as jsessionid .the spl query to find all transactions which lasted less than 5 sec :

should i take :

*|transaction jsessionid maxspan=5

or 

*|transaction jsessionid timelimit=5

im finding it hard to see the different between them

or

we dont add maxspan or timelimit since it is less than 5 sec

 

Labels (1)
Tags (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

@kimmyb 

Using transaction can generally be replaced with the stats command. transaction has numerous limitations if dealing with "long" transactions and larger data sets where the results you get cannot be reliable.

It is simple to use this basic stats replacement

search...
| stats min(_time) as min max(_time) as max by jsessionid
| where max-min<5

note that you can pass down any other fields you want, even "list(_raw)" in the stats to get all possible events.

or you can use streamstats, e.g.

| streamstats global=f range(_time) as range by jsessionid
| where range<5

 Neither of these have the limitations of transaction and will be reliable

0 Karma

johnhuang
Motivator
| transaction jsessionid
| where duration<5
0 Karma

FelixLeh
Contributor

| transaction jsessionid maxspan=5s means that the first and the last event the transaction is build with can't be further apart than 5 seconds. You can also set minutes or hours like this:
- maxspan=10m
- maxspan=1h

 

Edit:

As far as I know there is no timelimit option for the transaction command.
I also wasn't able to find it in the documentation for the command:

https://docs.splunk.com/Documentation/Splunk/9.0.1/SearchReference/Transaction

0 Karma

kimmyb
Loves-to-Learn

And if you can only chose  maxspan, timelimit , time , or nothing? 

In my exercise i could only take those? Where 3 are wrong 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

As @FelixLeh pointed out, the maxspan is a valid option and will limit any transaction length to 5s. The others are not valid transaction options.

If the question is to find transactions less than 5 seconds, then maxspan it is

Read the man pages here - it should clarify

https://docs.splunk.com/Documentation/Splunk/9.0.1/SearchReference/Transaction#Txn_definition_option...

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

How much can you really learn in 3 minutes?

Observability can certainly be hard to understand – there's a lot of jargon and buzzwords and it seems to ...

Event Series: The Agentic SOC: Trust Before Autonomy

AI is fundamentally changing security operations, but true progress requires more than just automation—it ...

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...