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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...