<?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: combine two search results tables by matching fields value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453323#M172300</link>
    <description>&lt;P&gt;@kannu - For the multisearch query I see what the issue is , try the below.&lt;/P&gt;

&lt;P&gt;|multisearch [search index=_internal ("version" AND source="/opt/splunk/var/log/splunk/metrics.log")][search index=* source=computer]|rename hostname as host|stats latest(version) AS Version latest(Manufacturer) AS Manufacturer by host&lt;/P&gt;

&lt;P&gt;An alternate option is to create a lookup that's updated once a day for manufacturer and then use it to populate your other search.&lt;/P&gt;

&lt;P&gt;You can use index=* source=computer |stats count by host,Manufacturer to populate your lookup and then use the same as a lookup for the internal data search&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2019 14:37:25 GMT</pubDate>
    <dc:creator>vik_splunk</dc:creator>
    <dc:date>2019-03-22T14:37:25Z</dc:date>
    <item>
      <title>combine two search results tables by matching fields value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453319#M172296</link>
      <description>&lt;P&gt;Hello Guys ,&lt;/P&gt;

&lt;P&gt;I am having results from two different query &lt;/P&gt;

&lt;P&gt;1&amp;gt; index=_internal ("version" AND source="/opt/splunk/var/log/splunk/metrics.log") | table hostname , version&lt;/P&gt;

&lt;P&gt;output &lt;BR /&gt;
hostname           version&lt;BR /&gt;
abc.com               6.6.2&lt;/P&gt;

&lt;P&gt;2&amp;gt; index=* source=computer |stats count by host,Manufacturer&lt;/P&gt;

&lt;P&gt;host                      Manufacturer&lt;BR /&gt;
abc.com               HP&lt;/P&gt;

&lt;P&gt;Is there any way in which i can combine the results of two into one by correlating hostname and host field  .&lt;/P&gt;

&lt;P&gt;expected output&lt;/P&gt;

&lt;P&gt;host           version      Manufacturer&lt;BR /&gt;
abc.com       6.6.2             HP&lt;/P&gt;

&lt;P&gt;I dont want to use join command to get the expected output&lt;/P&gt;

&lt;P&gt;please help &lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Manish&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 13:12:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453319#M172296</guid>
      <dc:creator>kannu</dc:creator>
      <dc:date>2019-03-22T13:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: combine two search results tables by matching fields value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453320#M172297</link>
      <description>&lt;P&gt;Considering you do not want to use join, see if the following approach works for you.&lt;/P&gt;

&lt;P&gt;|multisearch [search index=_internal ("version" AND source="/opt/splunk/var/log/splunk/metrics.log")][search  index=* source=computer]|stats latest(version) AS Version latest(Manufacturer) AS Manufacturer by host&lt;/P&gt;

&lt;P&gt;Is there a reason you do not want to use join?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 13:47:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453320#M172297</guid>
      <dc:creator>vik_splunk</dc:creator>
      <dc:date>2019-03-22T13:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: combine two search results tables by matching fields value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453321#M172298</link>
      <description>&lt;P&gt;@vik_splunk &lt;/P&gt;

&lt;P&gt;Actually join command is very heavy , in production i have more than 4000 hosts so comparing each host value with hostname entry was taking almost 10 minutes for completing the result &lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 14:11:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453321#M172298</guid>
      <dc:creator>kannu</dc:creator>
      <dc:date>2019-03-22T14:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: combine two search results tables by matching fields value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453322#M172299</link>
      <description>&lt;P&gt;Hello @vik_splunk &lt;/P&gt;

&lt;P&gt;I tried running your search but output is not coming as expected &lt;/P&gt;

&lt;P&gt;host                                  Version   Manufacturer&lt;BR /&gt;
ANMqweMIewwSe01                      VMware, Inc.&lt;BR /&gt;
MINEqweq                                             HP&lt;BR /&gt;
andndasdasnk-idx-01        6.6.7&lt;BR /&gt;&lt;BR /&gt;
andndasdaunk-idx-02       6.6.7&lt;BR /&gt;&lt;BR /&gt;
andnddsadunk-idx-03       6.6.2&lt;BR /&gt;&lt;BR /&gt;
anasddlunk-mn-01          6.6.2  &lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 14:14:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453322#M172299</guid>
      <dc:creator>kannu</dc:creator>
      <dc:date>2019-03-22T14:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: combine two search results tables by matching fields value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453323#M172300</link>
      <description>&lt;P&gt;@kannu - For the multisearch query I see what the issue is , try the below.&lt;/P&gt;

&lt;P&gt;|multisearch [search index=_internal ("version" AND source="/opt/splunk/var/log/splunk/metrics.log")][search index=* source=computer]|rename hostname as host|stats latest(version) AS Version latest(Manufacturer) AS Manufacturer by host&lt;/P&gt;

&lt;P&gt;An alternate option is to create a lookup that's updated once a day for manufacturer and then use it to populate your other search.&lt;/P&gt;

&lt;P&gt;You can use index=* source=computer |stats count by host,Manufacturer to populate your lookup and then use the same as a lookup for the internal data search&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 14:37:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453323#M172300</guid>
      <dc:creator>vik_splunk</dc:creator>
      <dc:date>2019-03-22T14:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: combine two search results tables by matching fields value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453324#M172301</link>
      <description>&lt;P&gt;@vik_splunk &lt;/P&gt;

&lt;P&gt;Its still not working Manufacturer column is not getting populated&lt;/P&gt;

&lt;P&gt;host    Version Manufacturer&lt;BR /&gt;
AN2SQLTEST01    6.6.2&lt;BR /&gt;&lt;BR /&gt;
ANMAADMINTS01   6.4.3&lt;BR /&gt;&lt;BR /&gt;
MINESM003   6.6.2&lt;BR /&gt;&lt;BR /&gt;
anddevcaspec02  6.6.2&lt;BR /&gt;&lt;BR /&gt;
anddevcaspec03  6.6.2&lt;BR /&gt;&lt;BR /&gt;
anddevcaspec05  6.6.2&lt;BR /&gt;&lt;BR /&gt;
anddevcaspec07  6.6.2&lt;BR /&gt;&lt;BR /&gt;
andndevsplunk-mn-01 6.6.7&lt;BR /&gt;&lt;BR /&gt;
andqacaspec02   6.6.2&lt;BR /&gt;&lt;BR /&gt;
anma1camcore001 7.2.0    &lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 15:41:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453324#M172301</guid>
      <dc:creator>kannu</dc:creator>
      <dc:date>2019-03-22T15:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: combine two search results tables by matching fields value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453325#M172302</link>
      <description>&lt;P&gt;@kannu. Can you please provide limited sample data(masked) for both your internal and your custom sourcetype to proceed?&lt;/P&gt;

&lt;P&gt;Make sure when you mask the data to match the hostname field in _internal to the host for which you are trying to get the manufacturer.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 08:07:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453325#M172302</guid>
      <dc:creator>vik_splunk</dc:creator>
      <dc:date>2019-03-26T08:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: combine two search results tables by matching fields value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453326#M172303</link>
      <description>&lt;P&gt;@vik_splunk &lt;/P&gt;

&lt;P&gt;That is my question actually as you are saying that match the hostname with host for which i am looking manufacturer .&lt;/P&gt;

&lt;P&gt;I said that matching can be done i am getting the result using join command only , is there any way except join in which i can map the hostname from _internal to host in .&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 10:37:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453326#M172303</guid>
      <dc:creator>kannu</dc:creator>
      <dc:date>2019-03-27T10:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: combine two search results tables by matching fields value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453327#M172304</link>
      <description>&lt;P&gt;@kannu - I believe it is possible without having to use join. Just need some sample data so I can build and test the query.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 09:42:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453327#M172304</guid>
      <dc:creator>vik_splunk</dc:creator>
      <dc:date>2019-03-28T09:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: combine two search results tables by matching fields value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453328#M172305</link>
      <description>&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=_internal "version" source="/opt/splunk/var/log/splunk/metrics.log") OR (index=* source=computer) | eval host=coalesce(host, hostname) | stats values(version) as version values(Manufacturer) as Manufacturer by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
-Kai.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 12:15:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453328#M172305</guid>
      <dc:creator>knielsen</dc:creator>
      <dc:date>2019-03-28T12:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: combine two search results tables by matching fields value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453329#M172306</link>
      <description>&lt;P&gt;@knielsen  .       Your query is not returning the result in manner which i want .&lt;/P&gt;

&lt;P&gt;SsdfWsdfC4                                             VMware, Inc.&lt;BR /&gt;
SWsdfBeF5                                                     VMware, Inc.&lt;BR /&gt;
ansdfging5                    5.0.3&lt;BR /&gt;&lt;BR /&gt;
asd1dfsing6                   5.0.3&lt;BR /&gt;&lt;BR /&gt;
ansdfsdfg2&lt;BR /&gt;&lt;BR /&gt;
                                          6.2.1&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 09:43:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-two-search-results-tables-by-matching-fields-value/m-p/453329#M172306</guid>
      <dc:creator>kannu</dc:creator>
      <dc:date>2019-04-15T09:43:16Z</dc:date>
    </item>
  </channel>
</rss>

