Getting Data In

where command with multiple sourcetypes

msarro
Builder

Greetings.
I am using multiple sourcetypes in a query that I am working with. If you open a search using something like this

sourcetype=SOURCE1 OR sourcetype=SOURCE2 OR sourcetype=SOURCE3

Playing around, if I try to filter anything with SOURCE1's events, all of the events from SOURCE2 and SOURCE3 get eliminated as well. For example (where AS_AS_Call_Type is an event field found only in SOURCE1):

sourcetype=SOURCE1 or sourcetype=SOURCE2 OR sourcetype=SOURCE3 AS_AS_Call_Type=network

Only events of SOURCE1 get returned. What I want is to keep all of the events from SOURCE2 and SOURCE3, along with the filtered events of SOURCE1.

How can I do this?

1 Solution

sophy
Splunk Employee
Splunk Employee

Hi!

Perhaps what you're trying to do is:

(sourcetype=SOURCE1 AS_AS_Call_Type=network) OR sourcetype=SOURCE2 OR sourcetype=SOURCE3

This will match events with "sourcetype=SOURCE1 AND AS_AS_Call_Type=network", as well as the other two sourcetypes.

Does that make sense?

View solution in original post

sophy
Splunk Employee
Splunk Employee

Hi!

Perhaps what you're trying to do is:

(sourcetype=SOURCE1 AS_AS_Call_Type=network) OR sourcetype=SOURCE2 OR sourcetype=SOURCE3

This will match events with "sourcetype=SOURCE1 AND AS_AS_Call_Type=network", as well as the other two sourcetypes.

Does that make sense?

msarro
Builder

Makes sense! The only command that seems not to be working is isnotnull(field) but I can do without that for now. Thank you!

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Updates (ESCU) - New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 3 releases of new content via the Enterprise ...

Thought Leaders are Validating Your Hard Work and Training Rigor

As a Splunk enthusiast and member of the Splunk Community, you are one of thousands who recognize the value of ...

.conf23 Registration is Now Open!

Time to toss the .conf-etti 🎉 —  .conf23 registration is open!   Join us in Las Vegas July 17-20 for ...