<?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: count of the exact match in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/count-of-the-exact-match/m-p/478648#M192879</link>
    <description>&lt;P&gt;@prettysunshinez &lt;/P&gt;

&lt;P&gt;You can use &lt;CODE&gt;rex&lt;/CODE&gt; command to get list of matching values in &lt;CODE&gt;myVal&lt;/CODE&gt; field.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/rex"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/rex&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Please try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=YourIndex  | rex max_match=0 field=_raw "(?&amp;lt;myVal&amp;gt;abcdef)" | eval count=mvcount(myVal)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="abcdef xgz mjjhj zkzkk abcdef" | rex max_match=0 field=_raw "(?&amp;lt;myVal&amp;gt;abcdef)" | eval count=mvcount(myVal)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here &lt;CODE&gt;abcdef&lt;/CODE&gt; is sample string.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2019 11:37:39 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-11-05T11:37:39Z</dc:date>
    <item>
      <title>count of the exact match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-of-the-exact-match/m-p/478647#M192878</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would want to have the count of a string (say "abcdef").&lt;BR /&gt;
sometimes the string occurs multiple times in the same event.&lt;BR /&gt;
But stats count by host is giving me the count of events where the string is present and not the count of string present inside an event also&lt;/P&gt;

&lt;P&gt;Kindly help!&lt;/P&gt;

&lt;P&gt;Thanks...&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 11:21:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-of-the-exact-match/m-p/478647#M192878</guid>
      <dc:creator>prettysunshinez</dc:creator>
      <dc:date>2019-11-05T11:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: count of the exact match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-of-the-exact-match/m-p/478648#M192879</link>
      <description>&lt;P&gt;@prettysunshinez &lt;/P&gt;

&lt;P&gt;You can use &lt;CODE&gt;rex&lt;/CODE&gt; command to get list of matching values in &lt;CODE&gt;myVal&lt;/CODE&gt; field.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/rex"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/rex&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Please try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=YourIndex  | rex max_match=0 field=_raw "(?&amp;lt;myVal&amp;gt;abcdef)" | eval count=mvcount(myVal)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="abcdef xgz mjjhj zkzkk abcdef" | rex max_match=0 field=_raw "(?&amp;lt;myVal&amp;gt;abcdef)" | eval count=mvcount(myVal)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here &lt;CODE&gt;abcdef&lt;/CODE&gt; is sample string.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 11:37:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-of-the-exact-match/m-p/478648#M192879</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-11-05T11:37:39Z</dc:date>
    </item>
  </channel>
</rss>

