<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to search all events from multiple sourcetypes that have a matching field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-all-events-from-multiple-sourcetypes-that-have-a/m-p/275567#M83125</link>
    <description>&lt;P&gt;This should do what you described above&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=opnsense [search sourcetype=Threat_script_match | stats count by threat_src_IP | rename threat_src_IP as src_IP ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The subsearch will generate list of distinct threat_src_IP field values and add it to base search as filter for field src_IP. So the resulting search would be like this. This will work if you've both threat_src_IP and src_IP field extracted.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=opnsense ((src_IP="X.X.X.X.) OR (src_IP="X.X.X.X.) OR.....(src_IP="X.X.X.X.))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 10:20:44 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2020-09-29T10:20:44Z</dc:date>
    <item>
      <title>How to search all events from multiple sourcetypes that have a matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-all-events-from-multiple-sourcetypes-that-have-a/m-p/275564#M83122</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I'm new to Splunk and I want make a search that finds all events from multiple sourcetypes that have a matching field. &lt;/P&gt;

&lt;P&gt;For example:&lt;BR /&gt;
I have a sourcetypeA (theat_script_match) whose only fields is an IP address and I have sourcetypeB (opnsense) with source and dest. IP fields.&lt;BR /&gt;&lt;BR /&gt;
I want to be able to do like a wildcard of sourcetypeA (which is much much smaller only ~500 events) and return all events from sourcetypeB that also contain the matching IP's. I can get the results I want using a giant chain of OR statements ie 1.1.1.1.1 OR 1.1.1.1.0 OR ... However that is not a good long term solution. &lt;/P&gt;

&lt;P&gt;Here's what I have so far:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=opnsense [search sourcetype=Threat_script_match | return threat_src_IP=src_IP]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help would be awesome, thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:20:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-all-events-from-multiple-sourcetypes-that-have-a/m-p/275564#M83122</guid>
      <dc:creator>festeves</dc:creator>
      <dc:date>2020-09-29T10:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to search all events from multiple sourcetypes that have a matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-all-events-from-multiple-sourcetypes-that-have-a/m-p/275565#M83123</link>
      <description>&lt;P&gt;You were almost there. Try like this .for field based search e.g. (src_IP=1.1.1.1 OR ..) OR (dest_IP=1.1.1.1 OR...)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=opnsense [search sourcetype=Threat_script_match | table threat_src_IP | rename threat_src_IP as src_IP ] OR [search sourcetype=Threat_script_match | table threat_src_IP | rename threat_src_IP as dest_IP ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR (for string based search e.g. 1.1.1.1.1 OR 1.1.1.1.0 OR ..., will be slower)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   sourcetype=opnsense [search sourcetype=Threat_script_match | table threat_src_IP | rename threat_src_IP as search ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:20:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-all-events-from-multiple-sourcetypes-that-have-a/m-p/275565#M83123</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T10:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to search all events from multiple sourcetypes that have a matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-all-events-from-multiple-sourcetypes-that-have-a/m-p/275566#M83124</link>
      <description>&lt;P&gt;Thanks for the response! &lt;BR /&gt;
I tried the solutions you offered and made tired my own changes however the search does not return any results.&lt;BR /&gt;&lt;BR /&gt;
Sourcetype=Threat_script_match contains events with only one field that is a IP address (Threat_scr_IP) &lt;BR /&gt;
Sourcetype=opnsense contains events from firewall logs which has many different fields however I am interested in the source IP (src_IP)&lt;BR /&gt;
What i'm trying to do is search is the intersection of events from both comparing the similar IP fields. Which is to show all the events from opnsense which have matched with the IPs from my threat_script_match. I have been reading about sub-searches and multisearches yet I can't find something similar on splunk docs to what I'm trying accomplish. &lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:17:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-all-events-from-multiple-sourcetypes-that-have-a/m-p/275566#M83124</guid>
      <dc:creator>festeves</dc:creator>
      <dc:date>2020-09-29T10:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to search all events from multiple sourcetypes that have a matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-all-events-from-multiple-sourcetypes-that-have-a/m-p/275567#M83125</link>
      <description>&lt;P&gt;This should do what you described above&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=opnsense [search sourcetype=Threat_script_match | stats count by threat_src_IP | rename threat_src_IP as src_IP ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The subsearch will generate list of distinct threat_src_IP field values and add it to base search as filter for field src_IP. So the resulting search would be like this. This will work if you've both threat_src_IP and src_IP field extracted.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=opnsense ((src_IP="X.X.X.X.) OR (src_IP="X.X.X.X.) OR.....(src_IP="X.X.X.X.))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:20:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-all-events-from-multiple-sourcetypes-that-have-a/m-p/275567#M83125</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T10:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to search all events from multiple sourcetypes that have a matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-all-events-from-multiple-sourcetypes-that-have-a/m-p/275568#M83126</link>
      <description>&lt;P&gt;Quick update;&lt;BR /&gt;
I used this search and it returned events that I'd like to see! Thanks! &lt;BR /&gt;
I'm having some other issues with the timeframe with my script but that's unrelated to this. I'm 1 step closer to a simple automated report i'm trying to do! &lt;BR /&gt;
Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2016 15:35:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-all-events-from-multiple-sourcetypes-that-have-a/m-p/275568#M83126</guid>
      <dc:creator>festeves</dc:creator>
      <dc:date>2016-07-22T15:35:57Z</dc:date>
    </item>
  </channel>
</rss>

