Splunk Enterprise Security

need some help in writing SPL for below scenerio

vikram1583
Explorer

i Have 2 source types each source type having asset_id field i want a search to display same asset_id that is in both source types

from that results i want to display nexpose_tag field for that asset_id from second source type

0 Karma

woodcock
Esteemed Legend

Like this:

(index="Index_A" AND sourcetype="sourcetype_A") OR (index="index_B" AND sourcetype=sourcetype_B")
| stats dc(sourcetype) AS sourcetypes valeues(nexpose_tag) AS nexpose_tag BY asset_id
| where sourcetypes=2
0 Karma

manjunathmeti
Champion

Hi @vikram1583, try this:

index=INDEXNAME (sourcetype=SOURCETYPE1 OR sourcetype=SOURCETYPE2)
| stats dc(sourcetype) AS sourcetypeCount values(nexpose_tag) AS nexpose_tag BY asset_id 
| where sourcetypeCount =2 
| fields asset_id, nexpose_tag
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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