<?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 How to combine two searches/data sets into one table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-data-sets-into-one-table/m-p/646713#M223844</link>
    <description>&lt;P class="lia-align-left"&gt;I have two searches/data sets that I would like to combine into a table, and am not entirely sure on what the correct process of completing the task is. I would like to use the Mandiant indicators/information and another search to look for activity that occurred and getting the data from both into one table with a total count of detected activity. If anyone could provide assistance or a recommendation with this matter it would be much appreciated.&lt;/P&gt;
&lt;P class="lia-align-left"&gt;First Search (Fields Needed: src_ip, dest, City, Country&lt;/P&gt;
&lt;P class="lia-align-left"&gt;index=pan_logs OR index=estreamer dest="*"&lt;BR /&gt;| iplocation src_ip | stats count by src_ip dest City Country&lt;/P&gt;
&lt;P class="lia-align-left"&gt;Second Search (Fields Needed: src_ip, category, mscore, type, malware, threat_actor&lt;/P&gt;
&lt;P class="lia-align-left"&gt;First Variation&lt;/P&gt;
&lt;P class="lia-align-left"&gt;| inputlookup mandiant_master_lookup | search type=ipv4 | eval src_ip=_key | table category mscore type malware threat_actor&lt;/P&gt;
&lt;P class="lia-align-left"&gt;Second Variation&lt;/P&gt;
&lt;P class="lia-align-left"&gt;| lookup mandiant_master_lookup _key as src_ip output category mscore type malware threat_actor&lt;/P&gt;
&lt;P class="lia-align-left"&gt;Attempted Join that didn't work&lt;/P&gt;
&lt;P class="lia-align-left"&gt;|index=pan_logs OR index=estreamer dest="*"&lt;BR /&gt;| iplocation src_ip | stats count by src_ip dest&amp;nbsp; City Country&lt;BR /&gt;| join type=outer indicator [inputlookup mandiant_master_lookup | eval src_ip=_key | table src_ip category mscore type malware threat_actor]&lt;BR /&gt;&lt;BR /&gt;Search that was Close, but needed additional iplocation data and action from device:&lt;/P&gt;
&lt;P class="lia-align-left"&gt;index=pan_logs OR index=estreamer dest="*"&lt;BR /&gt;| lookup mandiant_master_lookup _key as src_ip output category mscore type malware threat_actor&lt;BR /&gt;| fillnull value=""&lt;BR /&gt;| search type=ipv4 | makemv delim=";" category&lt;BR /&gt;| stats count by src_ip dest category mscore severity type malware threat_actor&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jun 2023 13:50:51 GMT</pubDate>
    <dc:creator>Apples</dc:creator>
    <dc:date>2023-06-13T13:50:51Z</dc:date>
    <item>
      <title>How to combine two searches/data sets into one table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-data-sets-into-one-table/m-p/646713#M223844</link>
      <description>&lt;P class="lia-align-left"&gt;I have two searches/data sets that I would like to combine into a table, and am not entirely sure on what the correct process of completing the task is. I would like to use the Mandiant indicators/information and another search to look for activity that occurred and getting the data from both into one table with a total count of detected activity. If anyone could provide assistance or a recommendation with this matter it would be much appreciated.&lt;/P&gt;
&lt;P class="lia-align-left"&gt;First Search (Fields Needed: src_ip, dest, City, Country&lt;/P&gt;
&lt;P class="lia-align-left"&gt;index=pan_logs OR index=estreamer dest="*"&lt;BR /&gt;| iplocation src_ip | stats count by src_ip dest City Country&lt;/P&gt;
&lt;P class="lia-align-left"&gt;Second Search (Fields Needed: src_ip, category, mscore, type, malware, threat_actor&lt;/P&gt;
&lt;P class="lia-align-left"&gt;First Variation&lt;/P&gt;
&lt;P class="lia-align-left"&gt;| inputlookup mandiant_master_lookup | search type=ipv4 | eval src_ip=_key | table category mscore type malware threat_actor&lt;/P&gt;
&lt;P class="lia-align-left"&gt;Second Variation&lt;/P&gt;
&lt;P class="lia-align-left"&gt;| lookup mandiant_master_lookup _key as src_ip output category mscore type malware threat_actor&lt;/P&gt;
&lt;P class="lia-align-left"&gt;Attempted Join that didn't work&lt;/P&gt;
&lt;P class="lia-align-left"&gt;|index=pan_logs OR index=estreamer dest="*"&lt;BR /&gt;| iplocation src_ip | stats count by src_ip dest&amp;nbsp; City Country&lt;BR /&gt;| join type=outer indicator [inputlookup mandiant_master_lookup | eval src_ip=_key | table src_ip category mscore type malware threat_actor]&lt;BR /&gt;&lt;BR /&gt;Search that was Close, but needed additional iplocation data and action from device:&lt;/P&gt;
&lt;P class="lia-align-left"&gt;index=pan_logs OR index=estreamer dest="*"&lt;BR /&gt;| lookup mandiant_master_lookup _key as src_ip output category mscore type malware threat_actor&lt;BR /&gt;| fillnull value=""&lt;BR /&gt;| search type=ipv4 | makemv delim=";" category&lt;BR /&gt;| stats count by src_ip dest category mscore severity type malware threat_actor&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 13:50:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-data-sets-into-one-table/m-p/646713#M223844</guid>
      <dc:creator>Apples</dc:creator>
      <dc:date>2023-06-13T13:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two searches/data sets into one table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-data-sets-into-one-table/m-p/646906#M223900</link>
      <description>&lt;P&gt;I'm confused. &amp;nbsp;In your first search, &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Iplocation#iplocation" target="_blank" rel="noopener"&gt;iplocation&lt;/A&gt; is shown as a command whose argument is an IP address. (But the output is not being used in that stats command.) &amp;nbsp;Then you mentioned that the last search is working (as look should be used), &amp;nbsp;except you need iplocation data. &amp;nbsp;What is preventing you from adding that data using iplocation? &amp;nbsp;Like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=pan_logs OR index=estreamer dest="*"
| lookup mandiant_master_lookup _key as src_ip output category mscore type malware threat_actor
| fillnull value=""
| search type=ipv4 | makemv delim=";" category
| stats count by src_ip dest category mscore severity type malware threat_actor
| iplocation src_ip&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 Jun 2023 04:55:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-data-sets-into-one-table/m-p/646906#M223900</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-06-14T04:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two searches/data sets into one table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-data-sets-into-one-table/m-p/647172#M224005</link>
      <description>&lt;P&gt;I thought that the iplocation command added the City and Country fields when being ran, which is why I added those fields to the stats count. You are right that I can just add it to the end which slipped my mind at the time. I would have also liked to get the device action from the initial search, but this is good enough. Thank you for your assistance.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 13:32:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-data-sets-into-one-table/m-p/647172#M224005</guid>
      <dc:creator>Apples</dc:creator>
      <dc:date>2023-06-15T13:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two searches/data sets into one table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-data-sets-into-one-table/m-p/647188#M224010</link>
      <description>&lt;P&gt;If the initial search has a field named device_action, you can pass it just like other fields. &amp;nbsp;If every event of interest has device_action (fully populated), include it in groupby&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=pan_logs OR index=estreamer dest="*"
| lookup mandiant_master_lookup _key as src_ip output category mscore type malware threat_actor
| fillnull value=""
| search type=ipv4 | makemv delim=";" category
| stats count by src_ip dest category mscore severity type malware threat_actor device_action
| iplocation src_ip&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If device_action is not fully populated, you can use values(), or populate missing values with another fillnull.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=pan_logs OR index=estreamer dest="*"
| lookup mandiant_master_lookup _key as src_ip output category mscore type malware threat_actor
| fillnull value=""
| search type=ipv4 | makemv delim=";" category
| stats count values(device_action) as device_action by src_ip dest category mscore severity type malware threat_actor
| iplocation src_ip&lt;/LI-CODE&gt;&lt;P&gt;or&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=pan_logs OR index=estreamer dest="*"
| fillnull device_action value="N/A"
| lookup mandiant_master_lookup _key as src_ip output category mscore type malware threat_actor
| fillnull value=""
| search type=ipv4 | makemv delim=";" category
| stats count by src_ip dest category mscore severity type malware threat_actor device_action
| iplocation src_ip&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 15 Jun 2023 16:01:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-data-sets-into-one-table/m-p/647188#M224010</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-06-15T16:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two searches/data sets into one table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-data-sets-into-one-table/m-p/647202#M224019</link>
      <description>&lt;P&gt;Thank you for the detailed responses, the answer provided is everything I needed. I think I had misunderstood the lookup/join, as I thought that it would only carry over the src_ip field from the first search that was matched in both searches.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 18:08:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-data-sets-into-one-table/m-p/647202#M224019</guid>
      <dc:creator>Apples</dc:creator>
      <dc:date>2023-06-15T18:08:28Z</dc:date>
    </item>
  </channel>
</rss>

