<?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 two sourcetypes to return fields in each sourcetype? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-two-sourcetypes-to-return-fields-in-each/m-p/249274#M189229</link>
    <description>&lt;P&gt;Hi Somesoni2,&lt;/P&gt;

&lt;P&gt;Thanks, it works like magic.&lt;/P&gt;

&lt;P&gt;How about you if it were a lookup table instead of a second source type, how would I achieve the same thing?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2016 21:34:06 GMT</pubDate>
    <dc:creator>Makinde</dc:creator>
    <dc:date>2016-01-27T21:34:06Z</dc:date>
    <item>
      <title>How to search two sourcetypes to return fields in each sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-two-sourcetypes-to-return-fields-in-each/m-p/249272#M189227</link>
      <description>&lt;P&gt;I don't know how best to do this, so any advice would work. Here is a brief explanation.&lt;/P&gt;

&lt;P&gt;We have the Qualys vulnerability management app. If anyone here is familiar with it, you will realize it has two source types;&lt;/P&gt;

&lt;P&gt;The two source types are the host_vulnerability source type and the knowledge_base source type. The Host_vulnerability source type contains the vulnerability it found on each device, but it contains mostly the device name, IP address, and the QID (which is just a number of the vulnerability). The knowledge_base source type on the other hand contains information about the vulnerability, so it also has the QID and give information about the implication of the vulnerability and the solution to fix it.&lt;/P&gt;

&lt;P&gt;I want to run a report that will return values from both source types, say for example, I run a search like this; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=qualys:host_detection  | stats count by qid, first_found_datetime, | sort -count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will generate a report of the most vulnerability in my environment in descending order, but all I have is the vulnerability ID and count. I know nothing about the vulnerability except I look it up in the knowledge_base source type. How can I generate this report in such a way that it will give me the solution and title field from the knowledge_base source type, along with the information I am getting already in the search above?&lt;/P&gt;

&lt;P&gt;I want both the best way to do this, either by using a lookup table or using a subsearch, or any other idea that will be the best way to go about it.&lt;/P&gt;

&lt;P&gt;I would like the sample search as well. so I can modify it and see how it works in my environment.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-two-sourcetypes-to-return-fields-in-each/m-p/249272#M189227</guid>
      <dc:creator>Makinde</dc:creator>
      <dc:date>2020-09-29T08:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to search two sourcetypes to return fields in each sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-two-sourcetypes-to-return-fields-in-each/m-p/249273#M189228</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=qualys:host_detection | stats count by qid, first_found_datetime | join qid [search index=main sourcetype=qualys:knowledge_base | stats values(fieldYouWantForVulnerability1) as fieldYouWantForVulnerability1 values(fieldYouWantForVulnerability2) as fieldYouWantForVulnerability2... by quid] 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jan 2016 17:27:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-two-sourcetypes-to-return-fields-in-each/m-p/249273#M189228</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-01-27T17:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to search two sourcetypes to return fields in each sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-two-sourcetypes-to-return-fields-in-each/m-p/249274#M189229</link>
      <description>&lt;P&gt;Hi Somesoni2,&lt;/P&gt;

&lt;P&gt;Thanks, it works like magic.&lt;/P&gt;

&lt;P&gt;How about you if it were a lookup table instead of a second source type, how would I achieve the same thing?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 21:34:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-two-sourcetypes-to-return-fields-in-each/m-p/249274#M189229</guid>
      <dc:creator>Makinde</dc:creator>
      <dc:date>2016-01-27T21:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to search two sourcetypes to return fields in each sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-two-sourcetypes-to-return-fields-in-each/m-p/249275#M189230</link>
      <description>&lt;P&gt;That's even easier/faster. (assuming lookup also has field name called qid)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=main sourcetype=qualys:host_detection | stats count by qid, first_found_datetime | lookup qid OUTPUT fieldYouWantForVulnerability1  fieldYouWantForVulnerability2...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jan 2016 22:43:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-two-sourcetypes-to-return-fields-in-each/m-p/249275#M189230</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-01-27T22:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to search two sourcetypes to return fields in each sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-two-sourcetypes-to-return-fields-in-each/m-p/249276#M189231</link>
      <description>&lt;P&gt;Thanks Somesoni2. It works.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 21:05:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-two-sourcetypes-to-return-fields-in-each/m-p/249276#M189231</guid>
      <dc:creator>Makinde</dc:creator>
      <dc:date>2016-01-28T21:05:32Z</dc:date>
    </item>
  </channel>
</rss>

