Splunk Search

i want to combine two source types and print the result

lavanyaanne
Path Finder

i have have two sourcetypes say sourcetype1 and sourcetype2 these two source type are in the same index
sourcetype1 has the fields CID and CN
sourcetype2 has the fields CID and Application

if in the two source types the CID matches i want to print the result CN,application
please help me

Tags (1)
0 Karma
1 Solution

sundareshr
Legend

Try this

index=* (sourcetype=st1 OR sourcetype=st2) | stats dc(sourcetype) as count values(CN) as CN values(application) as application by CID | where count=2

View solution in original post

0 Karma

woodcock
Esteemed Legend

Like this:

index=MyIndex (sourctype=sourcetype1 OR sourcetype=sourcetype2)
| stats dc(sourcetype) AS numSourcetypes values(*) AS * by CID
| search numSourcetypes=2
| table CN Application

sundareshr
Legend

Try this

index=* (sourcetype=st1 OR sourcetype=st2) | stats dc(sourcetype) as count values(CN) as CN values(application) as application by CID | where count=2
0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...

[Puzzles] Solve, Learn, Repeat: Dereferencing XML to Fixed-length events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Stay Connected: Your Guide to December Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...