Splunk Search

Nested Transactions? lookup tables or a better way?

mrflibbleuk
New Member

Hi,

I have a single large dataset that is related as follows. Each User has a UserID, when they login a SessionID is created, these Sessions then spawn TransactionID's which is a pair consisting of a request and a response.

The basic logic needs to go as follows:
I carry out a search on a particular UserID on the dataset.
I then collect all the SessionID's that are related to this UserID.
Then using this SessionID I collect a list of all TransactionID's that are used during this session.
Finally I lookup all of the TransactionID's so that I can view all requests and responses that the user has carried out.

I have tried a number of methods but cant seem to get this working correctly. Taking note that the SessionID does not appear in every log record. Sometimes a record is referred only by the TransactionID. The dataset is also huge so there is no way of carrying out a transaction statement on all records before I do the search.

As an interim I carried out the following to create an Index table and then run another search against this...and this works. But its clunky. Any ideas?

index=* [search CustomerID=9999 | fields SessionID] | fields LinkedID | table LinkedID | outputlookup transactions.csv

index=* [|inputlookup transactions.csv | fields + LinkedID] | transaction LinkedID

Cheers

Tags (2)
0 Karma

lguinn2
Legend

First, is all of the data in the same index? Or are the events split across a number of indexes - if so, how are they split?
What exactly do you want to see in the results?

This might work, or it might spark some new ideas...

LinkedID=* | sort _time | stats list(_time) as Timestamp list(_raw) as Events by LinkedID
| join type=outer LinkedID [ search customerID=9999 
                             | dedup SessionID LinkedID | fields SessionID LinkedId ]
| table SessionID LinkedID Timestamp Events
0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...