Splunk Search

dynamic lookup based upon dynamic token

tyronetv
Communicator

When my users log into my system they are identified with a token number that follows all of their activity going forward during that session.

What I want to do is say login=john.smith@hostname.com and have it track all the log entries that have the corresponding token. (-459867834847833)

Each time a user log's in, they get a new token.

Suggestions?

Tags (2)
0 Karma

Ayn
Legend

The challenge here I guess is that if you filter by "login=john.smith@hostname.com" you will get the token, BUT you filter out the other events that have the token but not the login info. A way of solving this would be to run this filter in a subsearch that emits all corresponding tokens for a certain login, and the outer search then grabs all events with these tokens. Finally use transaction for tying sessions with the same token value together. Assuming you have tokens extracted into a field called token:

* [search login=john.smith@hostname.com | fields token] | transaction token
0 Karma

Ayn
Legend

Right, so wouldn't this be solved by actually using this search but wrapping it inside some kind of form search view that lets users enter the login without having to worry about what goes on behind the scenes?

0 Karma

tyronetv
Communicator

I do something today that matches this and it works just fine. What I want is something I can put in props/transforms and allow other users to run the searches without teaching them this level of syntax.

I.e., just teach the support guy to type 'login = ??'

The system records the login ID only once, on the entry wherein the token is assigned. From that point forward, every log entry references the token only.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...