<?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: Search - count by 2 fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505496#M141268</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have just removed sorting based on lastUpdate from the query I posted in my question and then it is giving correct result.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=idx_1 source="idx_src_1" sourcetype="idx_srctype_1"
| rename COMMENT as "removed sorting data in descending order and only kept dedup for incident id"
| dedup incID 
| rename COMMENT as "to get the count of incidents for each team by incident status"
| chart count by incStatus,teamName&lt;/LI-CODE&gt;&lt;P&gt;I do not understand this behavior but it somehow worked.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jun 2020 13:32:40 GMT</pubDate>
    <dc:creator>madhav_dholakia</dc:creator>
    <dc:date>2020-06-22T13:32:40Z</dc:date>
    <item>
      <title>Search - count by 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505366#M141222</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a live database feed through DB Connect.&amp;nbsp;This feed is having incidents data for different teams and _time is set to last_updated.&lt;/P&gt;&lt;P&gt;I am trying to find count of different incident statuses by Teams , I am trying below search (with time-picker set to last 6 months) but it is not showing correct numbers:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=idx_1 source="idx_src_1" sourcetype="idx_srctype_1"
| rename COMMENT as "sorting data in descending order and removing duplicates by keeping the latest record for each incident id"
| sort -lastUpdate
| dedup incID 
| rename COMMENT as "to get the count of incidents for each team by incident status"
| chart count by incStatus,teamName&lt;/LI-CODE&gt;&lt;P&gt;but if I specify a team name in the search, it gives correct numbers:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=idx_1 source="idx_src_1" sourcetype="idx_srctype_1" teamName="Team1"
| rename COMMENT as "sorting data in descending order and removing duplicates by keeping the latest record for each incident id"
| sort -lastUpdate
| dedup incID 
| chart count by incStatus,teamName&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Can someone please suggest me on how to resolve this.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Madhav&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 04:26:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505366#M141222</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2020-06-21T04:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Search - count by 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505375#M141225</link>
      <description>Have you tried specifying "teamName=*" in the base query?</description>
      <pubDate>Sun, 21 Jun 2020 12:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505375#M141225</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-06-21T12:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Search - count by 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505436#M141243</link>
      <description>&lt;P&gt;Thank you. I have tried this but still not getting correct numbers.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 08:17:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505436#M141243</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2020-06-22T08:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Search - count by 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505496#M141268</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have just removed sorting based on lastUpdate from the query I posted in my question and then it is giving correct result.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=idx_1 source="idx_src_1" sourcetype="idx_srctype_1"
| rename COMMENT as "removed sorting data in descending order and only kept dedup for incident id"
| dedup incID 
| rename COMMENT as "to get the count of incidents for each team by incident status"
| chart count by incStatus,teamName&lt;/LI-CODE&gt;&lt;P&gt;I do not understand this behavior but it somehow worked.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 13:32:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505496#M141268</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2020-06-22T13:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Search - count by 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505560#M141286</link>
      <description>&lt;P&gt;How many events are being looked at when teamName is not specified?&amp;nbsp; The sort command has a default limit of 10000 results so you may have been hitting that limit looking at all teams.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 17:41:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505560#M141286</guid>
      <dc:creator>robinsonalex88</dc:creator>
      <dc:date>2020-06-22T17:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Search - count by 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505651#M141362</link>
      <description>&lt;P&gt;Thank you, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/32544"&gt;@robinsonalex88&lt;/a&gt; - yes, there were 20k+ events and I was using | sort without specifying "0". After I added "| sort 0 -lastUpdate", it works fine and gives correct numbers.&lt;/P&gt;&lt;P&gt;So just for my understanding, if we use just "| sort" and have more than 10k+ events, it will consider only those events to get the results, correct?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 05:46:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505651#M141362</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2020-06-23T05:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Search - count by 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505729#M141391</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/65114"&gt;@madhav_dholakia&lt;/a&gt;yes if no limit is specified with the |sort command then it will only return 10k results.&amp;nbsp; So your subsequent |dedup and |chart commands were only looking at 10k results instead of the full data set returned by the initial search.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 12:43:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505729#M141391</guid>
      <dc:creator>robinsonalex88</dc:creator>
      <dc:date>2020-06-23T12:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Search - count by 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505730#M141392</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/32544"&gt;@robinsonalex88&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 12:48:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-count-by-2-fields/m-p/505730#M141392</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2020-06-23T12:48:38Z</dc:date>
    </item>
  </channel>
</rss>

