<?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 compare two difference sources and return events that have the same hostname in both sources? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276041#M83269</link>
    <description>&lt;P&gt;index=abc source=source1 |join hostname [index=abc source=source2]|table hostname,ipaddress,os,os_version&lt;/P&gt;</description>
    <pubDate>Tue, 09 Feb 2016 18:56:49 GMT</pubDate>
    <dc:creator>chaseto</dc:creator>
    <dc:date>2016-02-09T18:56:49Z</dc:date>
    <item>
      <title>How to compare two difference sources and return events that have the same hostname in both sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276033#M83261</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;

&lt;P&gt;I have 2 different sources &lt;/P&gt;

&lt;P&gt;source 1 has hostname, ip address &lt;BR /&gt;
source 2 has hostname, os, os version&lt;/P&gt;

&lt;P&gt;I want to do a comparison on both the sources and get the events which have hostname common in both the sources. How this can be done?...Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 22:15:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276033#M83261</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2016-02-08T22:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two difference sources and return events that have the same hostname in both sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276034#M83262</link>
      <description>&lt;P&gt;... | join hostname | table hostname ipaddress, osversion&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 22:58:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276034#M83262</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2016-02-08T22:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two difference sources and return events that have the same hostname in both sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276035#M83263</link>
      <description>&lt;P&gt;If you just want common host name, try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=foo source=source1) OR (index=bar source=source1) | fields source hostname | stats values(source) as source by hostname | where mvcount(source)=2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(your base search for source1) | stats count by source hostname | append [ search (your base search for source2) |stats count by source hostname] | stats values(source) as source by hostname | where mvcount(source)=2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to merge both the sources to show fields for common hostnames, try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=foo source=source1) OR (index=bar source=source1) | fields source hostname ip_address os os_version | stats values(*) as source by hostname | where mvcount(source)=2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Feb 2016 23:01:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276035#M83263</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-08T23:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two difference sources and return events that have the same hostname in both sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276036#M83264</link>
      <description>&lt;P&gt;Thanks somesh,will try this but   In the below query of yours&lt;/P&gt;

&lt;P&gt;(index=foo source=source1) OR (index=bar source=source1) | fields source hostname ip_address os os_version | stats values(*) as source by hostname | where mvcount(source)=2&lt;/P&gt;

&lt;P&gt;what should I replace source   and source1 in mine  and in mvcount(source) ...its kinda confusing source,source1.....my sources are source1 and source2&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:42:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276036#M83264</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2020-09-29T08:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two difference sources and return events that have the same hostname in both sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276037#M83265</link>
      <description>&lt;P&gt;source1                                                                         &lt;/P&gt;

&lt;P&gt;hostname     ip_address                                                &lt;/P&gt;

&lt;P&gt;abcq123        123.1.5.22                                                     &lt;/P&gt;

&lt;P&gt;fwef123        109.1.1.101                                                 &lt;/P&gt;

&lt;P&gt;source 2&lt;BR /&gt;
  hostname         os                            os_version&lt;BR /&gt;
    abcq123            windows              10&lt;BR /&gt;
      jnknkn122      ubuntu                  5 &lt;/P&gt;

&lt;P&gt;result:&lt;/P&gt;

&lt;P&gt;hostname     ip_address          os                   os_version&lt;/P&gt;

&lt;P&gt;abcq123        123.1.5.22     windows              10&lt;/P&gt;

&lt;P&gt;fwef123        109.1.1.101          &lt;/P&gt;

&lt;P&gt;jnknkn122                                ubuntu                5 &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:41:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276037#M83265</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2020-09-29T08:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two difference sources and return events that have the same hostname in both sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276038#M83266</link>
      <description>&lt;P&gt;Ok.. What are your queries to get data from both the sources? &lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 04:45:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276038#M83266</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-09T04:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two difference sources and return events that have the same hostname in both sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276039#M83267</link>
      <description>&lt;P&gt;ya need the records from both sources &lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 16:55:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276039#M83267</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2016-02-09T16:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two difference sources and return events that have the same hostname in both sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276040#M83268</link>
      <description>&lt;P&gt;No, what is the query that you write to get result from the source? &lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 18:07:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276040#M83268</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-09T18:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two difference sources and return events that have the same hostname in both sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276041#M83269</link>
      <description>&lt;P&gt;index=abc source=source1 |join hostname [index=abc source=source2]|table hostname,ipaddress,os,os_version&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 18:56:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-difference-sources-and-return-events-that/m-p/276041#M83269</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2016-02-09T18:56:49Z</dc:date>
    </item>
  </channel>
</rss>

