<?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 values from 2 different rows? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-values-from-2-different-rows/m-p/492781#M194361</link>
    <description>&lt;P&gt;maybe try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1
| eval user="bob,rob,todd,jon,max,ben"
| makemv delim="," user
| mvexpand user
| eval age = random()%4
| stats values(user) as all_users_with_same_age by age
| eval OK = if(mvcount(all_users_with_same_age) &amp;gt; 1,"OK","NOT OK")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
    <pubDate>Thu, 03 Oct 2019 18:44:59 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2019-10-03T18:44:59Z</dc:date>
    <item>
      <title>How to compare values from 2 different rows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-values-from-2-different-rows/m-p/492779#M194359</link>
      <description>&lt;P&gt;Good afternoon&lt;/P&gt;

&lt;P&gt;could someone help me with this query:&lt;/P&gt;

&lt;P&gt;I have the following values&lt;/P&gt;

&lt;P&gt;| users | Age |&lt;BR /&gt;
&amp;nbsp; user1 | 99&lt;BR /&gt;
&amp;nbsp; user2 | 99&lt;/P&gt;

&lt;P&gt;How can I compare that if the user user1 of age 99 is equal to the user of age 99, then OK?&lt;/P&gt;

&lt;P&gt;The field that has these users is called user and age has the values for each user&lt;/P&gt;

&lt;P&gt;Any help is appreciated&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 18:08:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-values-from-2-different-rows/m-p/492779#M194359</guid>
      <dc:creator>efaundez</dc:creator>
      <dc:date>2019-10-03T18:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare values from 2 different rows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-values-from-2-different-rows/m-p/492780#M194360</link>
      <description>&lt;P&gt;Can you further clarify? Are you comparing user1=user2 or age of user1 = age of user2? What does OK mean?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 18:37:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-values-from-2-different-rows/m-p/492780#M194360</guid>
      <dc:creator>jacobpevans</dc:creator>
      <dc:date>2019-10-03T18:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare values from 2 different rows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-values-from-2-different-rows/m-p/492781#M194361</link>
      <description>&lt;P&gt;maybe try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1
| eval user="bob,rob,todd,jon,max,ben"
| makemv delim="," user
| mvexpand user
| eval age = random()%4
| stats values(user) as all_users_with_same_age by age
| eval OK = if(mvcount(all_users_with_same_age) &amp;gt; 1,"OK","NOT OK")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 18:44:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-values-from-2-different-rows/m-p/492781#M194361</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-10-03T18:44:59Z</dc:date>
    </item>
  </channel>
</rss>

