<?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 2 different rows using count in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625365#M217388</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252474"&gt;@villnooB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you try following qurey,&amp;nbsp;highlight lines are are newly added&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| convert timeformat="%F %H:%M" ctime(zone) as ctime&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| stats count by user fullname country ctime location&lt;BR /&gt;&lt;STRONG&gt;| eval Filter=if(location="Office","Yes","NO")&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;| search&amp;nbsp;Filter="Yes"&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;| rename fullname as "Name", ctime as DateStamp, location as "Location", user as "NetworkID", country as "Country"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| fields - count&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| sort 0 NetworkID&lt;BR /&gt;|&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Dec 2022 05:06:55 GMT</pubDate>
    <dc:creator>SanjayReddy</dc:creator>
    <dc:date>2022-12-28T05:06:55Z</dc:date>
    <item>
      <title>How to compare 2 different rows using count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625356#M217386</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;Can you please help me , I am trying to create a query in which it shows if a user is in&amp;nbsp; a different location in the sameday it will only prioritize one of it. please see below&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| convert timeformat="%F %H:%M" ctime(zone) as ctime
| stats count by user fullname country ctime location
| rename fullname as "Name", ctime as DateStamp, location as "Location", user as "NetworkID", country as "Country"
| fields - count
| sort 0 NetworkID

&lt;/LI-CODE&gt;
&lt;P&gt;This is what i am getting if I'm using the query above&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;NetworkID&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Name&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;Country&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;DateStamp&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Location&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="47px"&gt;userA&lt;/TD&gt;
&lt;TD width="25%" height="47px"&gt;A Sample&lt;/TD&gt;
&lt;TD width="12.5%" height="47px"&gt;Spain&lt;/TD&gt;
&lt;TD width="12.5%" height="47px"&gt;12-26-2022&lt;/TD&gt;
&lt;TD width="25%" height="47px"&gt;Office&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="47px"&gt;&lt;STRONG&gt;userA&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="47px"&gt;&lt;STRONG&gt;A Sample&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="47px"&gt;&lt;STRONG&gt;Spain&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="47px"&gt;&lt;STRONG&gt;12-27-2022&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="47px"&gt;&lt;STRONG&gt;Office&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="47px"&gt;&lt;STRONG&gt;userA&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD height="47px"&gt;&lt;STRONG&gt;A Sample&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD height="47px"&gt;&lt;STRONG&gt;Spain&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD height="47px"&gt;&lt;STRONG&gt;12-27-2022&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD height="47px"&gt;&lt;STRONG&gt;Home&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and this is what I am trying to get that If it's in the same day it will only Select the office&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;NetworkID&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Name&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;Country&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;DateStamp&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Location&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="47px"&gt;userA&lt;/TD&gt;
&lt;TD width="25%" height="47px"&gt;A Sample&lt;/TD&gt;
&lt;TD width="12.5%" height="47px"&gt;Spain&lt;/TD&gt;
&lt;TD width="12.5%" height="47px"&gt;12-26-2022&lt;/TD&gt;
&lt;TD width="25%" height="47px"&gt;Office&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="47px"&gt;&lt;STRONG&gt;userA&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="47px"&gt;&lt;STRONG&gt;A Sample&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="47px"&gt;&lt;STRONG&gt;Spain&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="47px"&gt;&lt;STRONG&gt;12-27-2022&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="47px"&gt;&lt;STRONG&gt;Office&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 04:17:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625356#M217386</guid>
      <dc:creator>villnooB</dc:creator>
      <dc:date>2022-12-29T04:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare 2 different rows using count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625365#M217388</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252474"&gt;@villnooB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you try following qurey,&amp;nbsp;highlight lines are are newly added&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| convert timeformat="%F %H:%M" ctime(zone) as ctime&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| stats count by user fullname country ctime location&lt;BR /&gt;&lt;STRONG&gt;| eval Filter=if(location="Office","Yes","NO")&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;| search&amp;nbsp;Filter="Yes"&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;| rename fullname as "Name", ctime as DateStamp, location as "Location", user as "NetworkID", country as "Country"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| fields - count&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| sort 0 NetworkID&lt;BR /&gt;|&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 05:06:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625365#M217388</guid>
      <dc:creator>SanjayReddy</dc:creator>
      <dc:date>2022-12-28T05:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare 2 different rows using count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625384#M217393</link>
      <description>&lt;LI-CODE lang="markup"&gt;| convert timeformat="%F %H:%M" ctime(zone) as ctime
| stats count values(location) as location by user fullname country ctime
| rename fullname as "Name", ctime as DateStamp, location as "Location", user as "NetworkID", country as "Country"
| fields - count
| eval Location=if(isnotnull(mvfind(Location, "Office")), "Office", "Home")
| sort 0 NetworkID&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 28 Dec 2022 07:55:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625384#M217393</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-12-28T07:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare 2 different rows using count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625386#M217394</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252474"&gt;@villnooB&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After rename, add the below logic&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;| eventstats count as multiple by DateStamp Name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| eval valid=if(multiple&amp;gt;1 AND Location="Home","NO","YES")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| search valid="YES"&lt;BR /&gt;&lt;/SPAN&gt;|fields - count multiple valid&lt;/P&gt;&lt;P&gt;If this helps, karma would be appreciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Manasa&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 08:05:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625386#M217394</guid>
      <dc:creator>Manasa_401</dc:creator>
      <dc:date>2022-12-28T08:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare 2 different rows using count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625414#M217399</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 12:10:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625414#M217399</guid>
      <dc:creator>villnooB</dc:creator>
      <dc:date>2022-12-28T12:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare 2 different rows using count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625415#M217400</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251844"&gt;@Manasa_401&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236694"&gt;@SanjayReddy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you very much for the help&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 12:11:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-different-rows-using-count/m-p/625415#M217400</guid>
      <dc:creator>villnooB</dc:creator>
      <dc:date>2022-12-28T12:11:12Z</dc:date>
    </item>
  </channel>
</rss>

