<?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: Splunk query to display count based on message in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578942#M201773</link>
    <description>&lt;P&gt;I apologize for lack of clarity here&lt;/P&gt;&lt;P&gt;I have a field "objectName"&amp;nbsp; which refers to different projects like IT256, IT345 and so on and "message" field which shows messages like "Failed project on &amp;lt;objectname&amp;gt;" .&lt;/P&gt;&lt;P&gt;requirement is, say 3 times there had been a failure occurred and 4th time it should generate an incident.&lt;/P&gt;&lt;P&gt;This applies to each of the objectName here is ,&lt;/P&gt;&lt;P&gt;ex IT256 failed 2 times- as the count is 2 -don't generate incident&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; IT345 failed 4 times - as the count is greater than 3 generate an incident.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Dec 2021 16:20:06 GMT</pubDate>
    <dc:creator>nanoo1</dc:creator>
    <dc:date>2021-12-20T16:20:06Z</dc:date>
    <item>
      <title>Splunk query to display count based on message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578887#M201752</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need a help with a query to display the count based on a particular message. For example, "Failed project on ABC", the query basically should read and count 2 and if it's greater than 2 , should display the number&lt;/P&gt;&lt;P&gt;I tried something like this, but not working&lt;/P&gt;&lt;P&gt;index="Project" | stats count(eval(message like("%Failed Project on%")) | where count&amp;gt;2&lt;/P&gt;&lt;P&gt;Could someone suggest way of achieving this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/nanoo1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 09:46:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578887#M201752</guid>
      <dc:creator>nanoo1</dc:creator>
      <dc:date>2021-12-20T09:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to display count based on message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578889#M201754</link>
      <description>&lt;P&gt;This should do the trick ...&lt;/P&gt;&lt;P&gt;index=&lt;SPAN&gt;Project&lt;/SPAN&gt; "&lt;SPAN&gt;Failed Project on&lt;/SPAN&gt;"&lt;BR /&gt;| stats count AS Total&lt;BR /&gt;| search Total &amp;gt; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 09:50:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578889#M201754</guid>
      <dc:creator>Random_Walk</dc:creator>
      <dc:date>2021-12-20T09:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to display count based on message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578929#M201769</link>
      <description>&lt;P&gt;I tried above and it is working but not I expected.&lt;/P&gt;&lt;P&gt;| stats count As Total&amp;nbsp; &amp;nbsp;-&amp;gt; it is counting the number of occurrences like 2,1,1&lt;/P&gt;&lt;P&gt;| search Total &amp;gt; 2&amp;nbsp; -&amp;gt; it is displaying overall value&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For the below table if you see, and above query, it should not display any event as there is no data with &amp;gt;2&lt;/P&gt;&lt;P&gt;but it is displaying 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;TABLE border="0" width="128" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="64" height="20"&gt;Project&lt;/TD&gt;&lt;TD width="64"&gt;Failed Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="64" height="20"&gt;&lt;A href="https://splunk.ikea.com/en-US/app/RubrikSplunkApp/search?q=%7C%20from%20datamodel%3A%22rubrik_dataset_backup_job_events%22%20%7C%20where%20clusterName%3D%3D%22ITSEDC07-SD02D%22%20and%20message%20like%20%22%25Failed%20log%20backup%20of%20Oracle%20Database%25%22%20%7C%20stats%20count%20As%20Total%20%7C%20%20search%20Total%3E4%20%7Cdedup%20objectName&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;earliest=-30m&amp;amp;latest=now&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=statistics&amp;amp;display.events.type=list&amp;amp;sid=1640011248.28879_68513B4D-0669-46D0-BEC2-6034341B49E2" target="_blank" rel="noopener"&gt;ITC029&lt;/A&gt;&lt;/TD&gt;&lt;TD width="64"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="64" height="39"&gt;&lt;A href="https://splunk.ikea.com/en-US/app/RubrikSplunkApp/search?q=%7C%20from%20datamodel%3A%22rubrik_dataset_backup_job_events%22%20%7C%20where%20clusterName%3D%3D%22ITSEDC07-SD02D%22%20and%20message%20like%20%22%25Failed%20log%20backup%20of%20Oracle%20Database%25%22%20%7C%20stats%20count%20As%20Total%20%7C%20%20search%20Total%3E4%20%7Cdedup%20objectName&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;earliest=-30m&amp;amp;latest=now&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=statistics&amp;amp;display.events.type=list&amp;amp;sid=1640011248.28879_68513B4D-0669-46D0-BEC2-6034341B49E2" target="_blank" rel="noopener"&gt;ITC1034&lt;/A&gt;&lt;/TD&gt;&lt;TD width="64"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="64" height="39"&gt;&lt;A href="https://splunk.ikea.com/en-US/app/RubrikSplunkApp/search?q=%7C%20from%20datamodel%3A%22rubrik_dataset_backup_job_events%22%20%7C%20where%20clusterName%3D%3D%22ITSEDC07-SD02D%22%20and%20message%20like%20%22%25Failed%20log%20backup%20of%20Oracle%20Database%25%22%20%7C%20stats%20count%20As%20Total%20%7C%20%20search%20Total%3E4%20%7Cdedup%20objectName&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;earliest=-30m&amp;amp;latest=now&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=statistics&amp;amp;display.events.type=list&amp;amp;sid=1640011248.28879_68513B4D-0669-46D0-BEC2-6034341B49E2" target="_blank" rel="noopener"&gt;ITC1035&lt;/A&gt;&lt;/TD&gt;&lt;TD width="64"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 20 Dec 2021 14:44:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578929#M201769</guid>
      <dc:creator>nanoo1</dc:creator>
      <dc:date>2021-12-20T14:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to display count based on message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578941#M201772</link>
      <description>&lt;P&gt;Those results look like you have done a 'group by Project ' or similar with a Project field, like.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;index=Project "Failed Project on"&lt;BR /&gt;| rex "Failed Project on (&amp;lt;?Project&amp;gt;\w+)&lt;BR /&gt;|&amp;nbsp;&lt;/SPAN&gt;stats count As Total&amp;nbsp; BY Project&lt;BR /&gt;| search Total &amp;gt; 2&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is your exact search string? What fields have you extracted?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 15:44:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578941#M201772</guid>
      <dc:creator>Random_Walk</dc:creator>
      <dc:date>2021-12-20T15:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to display count based on message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578942#M201773</link>
      <description>&lt;P&gt;I apologize for lack of clarity here&lt;/P&gt;&lt;P&gt;I have a field "objectName"&amp;nbsp; which refers to different projects like IT256, IT345 and so on and "message" field which shows messages like "Failed project on &amp;lt;objectname&amp;gt;" .&lt;/P&gt;&lt;P&gt;requirement is, say 3 times there had been a failure occurred and 4th time it should generate an incident.&lt;/P&gt;&lt;P&gt;This applies to each of the objectName here is ,&lt;/P&gt;&lt;P&gt;ex IT256 failed 2 times- as the count is 2 -don't generate incident&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; IT345 failed 4 times - as the count is greater than 3 generate an incident.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 16:20:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578942#M201773</guid>
      <dc:creator>nanoo1</dc:creator>
      <dc:date>2021-12-20T16:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to display count based on message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578946#M201774</link>
      <description>&lt;P&gt;Just to add more here, here is complete search:&lt;/P&gt;&lt;P&gt;| from datamodel:"Project_job_events"| where clusterName=="ITS07-SD02A"&amp;nbsp;| where eventStatus=="Failure" | table _time,objectName,message,locationName,,eventStatus,objectType,objectId,_raw&lt;/P&gt;&lt;P&gt;I did below for each fields,&lt;/P&gt;&lt;P&gt;| eval json_field=split(_raw,",")&lt;BR /&gt;| eval field1=mvindex(json_field,1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| eval&lt;BR /&gt;itsi_entity=objectName,&lt;BR /&gt;itsi_event_key=objectId,&lt;BR /&gt;itsi_correlation_key=objectId,&lt;BR /&gt;message=message,&lt;BR /&gt;itsi_message="Alerting time: "+human_readable_time+"~~"+field1+"~~"+field2+"~~"+field3+"~~"+field4+"~~"+field5+"~~"+field6+"~~"+field7+"~~"+field8,&lt;BR /&gt;&lt;BR /&gt;itsi_impact=case(&lt;BR /&gt;message like("%Failed project %") |&amp;nbsp; ,"High"&lt;BR /&gt;message like("%Failed Compliance Project%"),"High",&lt;BR /&gt;true(), "Medium"),&lt;BR /&gt;itsi_urgency=case(&lt;BR /&gt;message like("%Failed project %"), "High",&lt;BR /&gt;message like("%Failed Compliance project%"), "High",&lt;BR /&gt;true(),"Medium")&lt;/P&gt;&lt;P&gt;Requirement - For a message like "Failed project" , the search should basically count for 3 times failure and then send an alert.&amp;nbsp; The below search works when we run index and so on but when try to keep in eval statement it does not. Moreover I tried keeping above itsi_impact and inside of that as well, still no luck&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 16:51:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-display-count-based-on-message/m-p/578946#M201774</guid>
      <dc:creator>nanoo1</dc:creator>
      <dc:date>2021-12-20T16:51:46Z</dc:date>
    </item>
  </channel>
</rss>

