<?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: Compare two sources with multiple value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-sources-with-multiple-value/m-p/493492#M194412</link>
    <description>&lt;P&gt;Hi @ gcusello, &lt;/P&gt;

&lt;P&gt;I add an example for more detail my case as my sharing&lt;/P&gt;</description>
    <pubDate>Tue, 08 Oct 2019 09:58:24 GMT</pubDate>
    <dc:creator>nguyenhuyhoang0</dc:creator>
    <dc:date>2019-10-08T09:58:24Z</dc:date>
    <item>
      <title>Compare two sources with multiple value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-sources-with-multiple-value/m-p/493489#M194409</link>
      <description>&lt;P&gt;Hi folks, &lt;/P&gt;

&lt;P&gt;Hi have a case needing to compare 2 sources with CSV type&lt;/P&gt;

&lt;P&gt;Source 1 has fields as below:&lt;BR /&gt;
start_time_s1, end_time_s1, source_ip_s1, account&lt;/P&gt;

&lt;P&gt;Source 2 has fileds as below: &lt;BR /&gt;
start_time_s2, end_time_s2, source_ip_s2 &lt;/P&gt;

&lt;P&gt;I need to compare with the condition: &lt;EM&gt;If&lt;/EM&gt; (start_time_s1 &amp;lt; start_time_s2) AND (end_time_s2 &amp;lt; end_time_s1) AND (source_ip_s2 = source_ip_s1) &lt;EM&gt;then&lt;/EM&gt; table start_time_s2, end_time_s2, source_ip_s2, account&lt;/P&gt;

&lt;P&gt;How way can I solve this query?&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:23:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-sources-with-multiple-value/m-p/493489#M194409</guid>
      <dc:creator>nguyenhuyhoang0</dc:creator>
      <dc:date>2020-09-30T02:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two sources with multiple value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-sources-with-multiple-value/m-p/493490#M194410</link>
      <description>&lt;P&gt;Hi nguyenhuyhoang0901,&lt;BR /&gt;
If you have these logs in two indexes, you could run something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 OR index=index2
| rename source_ip_s1 AS source_ip source_ip_s2 AS source_ip
| stats values(start_time_s1) AS start_time_s1 values(end_time_s1) AS end_time_s1 values(account) AS account values(start_time_s2) AS start_time_s2 values(end_time_s2) AS end_time_s2 BY source_ip
| where (start_time_s1 &amp;lt; start_time_s2) AND (end_time_s2 &amp;lt; end_time_s1)
| table start_time_s2 end_time_s2 source_ip account
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If instead you have two lookups it's just a little bit different:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup lookup_s1
| lookup lookup_s2 source_ip_s2 AS source_ip_s1 OUTPUT start_time_s2 end_time_s2
| where (start_time_s1 &amp;lt; start_time_s2) AND (end_time_s2 &amp;lt; end_time_s1)
| table start_time_s2 end_time_s2 source_ip_s2 account
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 06:45:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-sources-with-multiple-value/m-p/493490#M194410</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-07T06:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two sources with multiple value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-sources-with-multiple-value/m-p/493491#M194411</link>
      <description>&lt;P&gt;Hi gcusello, &lt;/P&gt;

&lt;P&gt;Thanks for your information. &lt;BR /&gt;
I describe more about my situation. &lt;BR /&gt;
the source IP may be repeated so it can't work with values(*) as * by source_ips properly. &lt;BR /&gt;
I give an example below: (assume that the time information was converted to timestamp) &lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/274857-splunk.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;the result needs to show a table and meet the criteria  (begin &amp;lt;= start_time) AND ( end_time &amp;lt;= stop) AND (ip = source_ips)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:24:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-sources-with-multiple-value/m-p/493491#M194411</guid>
      <dc:creator>nguyenhuyhoang0</dc:creator>
      <dc:date>2020-09-30T02:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two sources with multiple value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-sources-with-multiple-value/m-p/493492#M194412</link>
      <description>&lt;P&gt;Hi @ gcusello, &lt;/P&gt;

&lt;P&gt;I add an example for more detail my case as my sharing&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 09:58:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-sources-with-multiple-value/m-p/493492#M194412</guid>
      <dc:creator>nguyenhuyhoang0</dc:creator>
      <dc:date>2019-10-08T09:58:24Z</dc:date>
    </item>
  </channel>
</rss>

