Splunk Enterprise

help to join information from 2 different sourcetype

jip31
Motivator

hi

I need to do a count on the field "titi" which exist in 2 different sourcetype following 2 conditions :

the field "cit" is related to the sourcetype "citrix" and the field "domain" is related to the sourcetype "web"

And "host" exist in both sourcetype

so I am doing something like this but i have no results

index=tutu sourcetype=citrix OR sourcetype=web
| search (cit<="3") AND domain=west
| stats dc(titi) by host

Is it enough to add a "by host" clause for matching the events or do I have to use a join command?

thanks

 

Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

As I said, you have a pipeline of events from both sourcetype, your AND condition at this point will not find events which match the criteria - try something like this

index=tutu sourcetype=citrix OR sourcetype=web
| where cit<=3 OR domain=west
| stats values(titi) as titi dc(cit) as cit dc(domain) as domain by host
| where cit>0 AND domain>0
| eval count=mvcount(titi)

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| search (cit<="3") AND domain=west

will find events in the pipeline that match these conditions - given that cit comes from one source type and domain comes from the other, there will be no events that match these conditions at the same time - try changing AND to OR

0 Karma

jip31
Motivator

my need is to count only the host that have a cit<3 and a domain=west

so if I replace AND by OR i think i am going to count a host that has a cit<3 or a host that has a domain=west, is it true?

If yes it's not my need, so do I have to use a join command to do that?

 

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

As I said, you have a pipeline of events from both sourcetype, your AND condition at this point will not find events which match the criteria - try something like this

index=tutu sourcetype=citrix OR sourcetype=web
| where cit<=3 OR domain=west
| stats values(titi) as titi dc(cit) as cit dc(domain) as domain by host
| where cit>0 AND domain>0
| eval count=mvcount(titi)
0 Karma

jip31
Motivator

ok thanks

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

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

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...