<?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 use mvcount to get the accurate count of a keyword by source in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-mvcount-to-get-the-accurate-count-of-a-keyword-by/m-p/485255#M135801</link>
    <description>&lt;P&gt;@skakani114 ,&lt;/P&gt;

&lt;P&gt;Try this and test against your data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="idx" source="*TAPSSC_123.123" "CLP"
|rex field=_raw max_match=0 "(?&amp;lt;clps&amp;gt;(?i)(CLP))"|stats count by clps
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 Sep 2019 04:36:18 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2019-09-24T04:36:18Z</dc:date>
    <item>
      <title>How to use mvcount to get the accurate count of a keyword by source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-mvcount-to-get-the-accurate-count-of-a-keyword-by/m-p/485254#M135800</link>
      <description>&lt;P&gt;I have logs that have a keyword "*CLP" repeated multiple times in each event. I am trying the get the total counts of CLP in each event. here is the search I am using. The problem I am facing is this search is working fine with small size events but when it comes to large events with more CLP counts, the results are not accurate. please help me to get the accurate count?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="idx" source="*TAPSSC_123.123"  "*CLP*" |eval tokens = lower(replace(_raw, "\W+", " ")) |makemv tokens |eval matches = mvfilter(match(tokens, "^clp$")) |eval count_CLP = mvcount(matches) |stats sum(count_CLP) as CLP_count by source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Log sample: &lt;BR /&gt;
You will see CLP keyword like that repeated multiple times in an event. &lt;BR /&gt;
&lt;STRONG&gt;abvfyatfpwutnqwa25~CLP*k123456*1REF*6T*P1282158997301~AMT*c120~CLP*P11802586130*1*356612125491516&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:15:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-mvcount-to-get-the-accurate-count-of-a-keyword-by/m-p/485254#M135800</guid>
      <dc:creator>skakani114</dc:creator>
      <dc:date>2020-09-30T02:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use mvcount to get the accurate count of a keyword by source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-mvcount-to-get-the-accurate-count-of-a-keyword-by/m-p/485255#M135801</link>
      <description>&lt;P&gt;@skakani114 ,&lt;/P&gt;

&lt;P&gt;Try this and test against your data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="idx" source="*TAPSSC_123.123" "CLP"
|rex field=_raw max_match=0 "(?&amp;lt;clps&amp;gt;(?i)(CLP))"|stats count by clps
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 04:36:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-mvcount-to-get-the-accurate-count-of-a-keyword-by/m-p/485255#M135801</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-09-24T04:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use mvcount to get the accurate count of a keyword by source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-mvcount-to-get-the-accurate-count-of-a-keyword-by/m-p/485256#M135802</link>
      <description>&lt;P&gt;Thankyou so much for you help. i use this query and i am still not getting the accurate result. could you please suggest how to proceed?&lt;BR /&gt;
 is there any limits.conf to check ?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 18:47:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-mvcount-to-get-the-accurate-count-of-a-keyword-by/m-p/485256#M135802</guid>
      <dc:creator>skakani114</dc:creator>
      <dc:date>2019-09-25T18:47:42Z</dc:date>
    </item>
  </channel>
</rss>

