Splunk Search

correlate value using common field

MrGlass
Engager

Here is my search in question, the common field is the SessionID

index=eis_lb apm_eis_rdp
|fillnull value="-"
|search UserID!="-"
| rex field=_raw "\/Common\/apm_eis_rdp:ent-eis[:a-zA-Z0-9_.-](?'SessionID'........)"
|search company_info="*"
|rename company_info as "Agency"
| table _time, SessionID, UserID,Full_Name, Agency, HostName, client_ip
| sort - _time

_time                                  SessionID UserID      Full_Name Agency   HostName client_ip
2024-03-22 08:25:29 4f89ae57 Redacted Redacted Redacted Redacted            -


If I remove the Search UserID I can see the matching session ID and the client_ip is present.


_time                               SessionID       UserID    Full_Name    Agency      HostName              client_ip

2024-03-22 14:26:48 4f89ae57     Redacted Redacted    Redacted   Redacted                    -
2024-03-22 14:25:52 4f89ae57 - - - -                                                                                                 Redacted


How can I create a search like above to show the client_ip maching the SessionID

Labels (1)
0 Karma
1 Solution

isoutamo
SplunkTrust
SplunkTrust

Hi

normally you could use e.g. stats to do correlation between events. In your case try e.g.

...
| stats first(_time) as _time values(*) as * by SessionID

This will generate one event by each SessionID with contains other fields as multivalue fields or if values was same in all combined events then normal field.

r. Ismo

View solution in original post

MrGlass
Engager

Thank You, this worked, the only thing I wish I could see is just the matched lines and get rid of the blank rows.

0 Karma

isoutamo
SplunkTrust
SplunkTrust
You should look e.g where an isnull function. With it you could drop unwanted rows away.
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

normally you could use e.g. stats to do correlation between events. In your case try e.g.

...
| stats first(_time) as _time values(*) as * by SessionID

This will generate one event by each SessionID with contains other fields as multivalue fields or if values was same in all combined events then normal field.

r. Ismo

Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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