<?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: Counting occurences of 5 specific strings in logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295713#M160343</link>
    <description>&lt;P&gt;@adonio, we all learn from each other. Your immaculate answers are always worth reading and most of the time I go BINGO, that is how it is done &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jul 2017 11:41:36 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-07-05T11:41:36Z</dc:date>
    <item>
      <title>Counting occurences of 5 specific strings in logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295710#M160340</link>
      <description>&lt;P&gt;For a given sourcetype=src I have to search for five specific strings (let it be "abc", "def", "ghi", "jkl", "mno") occuring in the log and give the counts of each of these strings for every 10 minutes.&lt;/P&gt;

&lt;P&gt;I had thought of doing it using join after calculating counts for each separately. Is there any better way of doing it since the sourcetype is the same.&lt;BR /&gt;
For each individual 1 I had planned to use the query&lt;BR /&gt;
 index=cm sourcetype=src "abc"| timechart span=10m count |join _time [....]&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 10:19:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295710#M160340</guid>
      <dc:creator>AshimaE</dc:creator>
      <dc:date>2017-07-05T10:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Counting occurences of 5 specific strings in logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295711#M160341</link>
      <description>&lt;P&gt;@AshimaE, If the strings are not already extracted as fields you can use &lt;STRONG&gt;searchmatch&lt;/STRONG&gt; eval function to count the same.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cm sourcetype=src ("abc"  OR "def" OR "ghi" OR "jkl" OR "mno")
| timechart span=10m count(eval(searchmatch("abc"))) as "abc" count(eval(searchmatch("def"))) as "def" count(eval(searchmatch("ghi"))) as "ghi" count(eval(searchmatch("jkl"))) as "jkl" count(eval(searchmatch("mno"))) as "mno"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since you are currently doing/planning this with join I am expecting events are not overlapping, i.e. event with "abc" will not have "def" and so on. If it does there will be different approach required. Please try out and confirm.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 10:54:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295711#M160341</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-05T10:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Counting occurences of 5 specific strings in logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295712#M160342</link>
      <description>&lt;P&gt;up-voting, i learned something new today!&lt;BR /&gt;
thanks @niketnilay&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 11:29:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295712#M160342</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-07-05T11:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Counting occurences of 5 specific strings in logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295713#M160343</link>
      <description>&lt;P&gt;@adonio, we all learn from each other. Your immaculate answers are always worth reading and most of the time I go BINGO, that is how it is done &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 11:41:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295713#M160343</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-05T11:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Counting occurences of 5 specific strings in logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295714#M160344</link>
      <description>&lt;P&gt;Yes they do not overlap so this approach works good with my purpose. Thanks a lot @niketnilay&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 07:08:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295714#M160344</guid>
      <dc:creator>AshimaE</dc:creator>
      <dc:date>2017-07-06T07:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Counting occurences of 5 specific strings in logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295715#M160345</link>
      <description>&lt;P&gt;Glad it worked!!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 08:12:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-occurences-of-5-specific-strings-in-logs/m-p/295715#M160345</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-06T08:12:40Z</dc:date>
    </item>
  </channel>
</rss>

