Splunk Search

extract one field from one index and pass to another search

ronj_clark
Explorer

Background:
My windows AD users are in index "windersAD". All of their web traffic is logged in index "wsa".
I would like to have a table with the timestamp, userID, source_IP, the URL, and the Web Category.

So far I have started with this:
index="winders" [ search index="wsa" eventtype=cisco-wsa-squid usage="Violation" x_webcat_code_full="Online Storage*" | fields src, cs_url | dedup src ] | table _time, user, src, cs_url, x_webcat_code_full | dedup src

What I get is "No results found". I don't think that I am passing the user filed values correctly. Please help!

Thanks in advance!

Tags (1)
0 Karma

sundareshr
Legend

Is there a common field between events windersAD index and wsa index to corelate the web logs with users? I assume wsa does not have user id? If there is you could try something like this

index=wsa [search index=windersAD | stats count by <common_field>>| table <<common_field>> ]  table _time userid src .....

Here is some good online documentation on sub-searches that you may find helpful for what you are trying to accomplish.

0 Karma

ronj_clark
Explorer

The only common field between the two indexes is the source IP field. The user ID field in in the WindersAD index and all of the other fields are in the wsa index. Thats the trouble I am having. Is how do I use the src IP and pull the user ID from one index (windersAD), and all of the other fields from the other (wsa) index?

0 Karma

sundareshr
Legend

Did you try

index=wsa [search index=windersAD | stats count by src_ip | table src_ip ]  table _time userid src .....

The field name that has the source IP has to be the same in both indexes for the above to work. If they are not, you can rename src_ip to whatever is the name in the wsa index

0 Karma
Get Updates on the Splunk Community!

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 ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...