<?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 edit my search to return a chart which counts failed and successful service executions and group by service name? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326132#M97240</link>
    <description>&lt;P&gt;I believe you want to use &lt;CODE&gt;sum(finished) and sum(failed)&lt;/CODE&gt; in the stats instead of &lt;CODE&gt;count&lt;/CODE&gt;. (or update &lt;CODE&gt;0&lt;/CODE&gt; with &lt;CODE&gt;null()&lt;/CODE&gt; in if conditions).&lt;/P&gt;</description>
    <pubDate>Mon, 27 Feb 2017 19:54:07 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-02-27T19:54:07Z</dc:date>
    <item>
      <title>How to edit my search to return a chart which counts failed and successful service executions and group by service name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326130#M97238</link>
      <description>&lt;P&gt;Hey Splunk community.&lt;/P&gt;

&lt;P&gt;i want to create a search that returns a chart which counts the failed and successful service executions, group by service name.&lt;BR /&gt;
As base i have several events of the following type:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   [-] 
     hostname:   iawmsis03  
     logMessage:     KL_Kpos.priv.bma.clientManagement:sendToUmDestination(uuid=b0be3a9f-5adc-4339-8e86-ca0f148290a3:txid=d40ff865-2edb-4930-8808-8e6ef67b6aab:storeNumber=0112:action=reinstall:country=CZ) Service finished.  
     loggingTimestamp:   Mon Feb 27 11:56:01 CET 2017   
     packageName:    KL_Kpos    
     serviceName:    KL_Kpos.priv.bma.clientManagement:sendToUmDestination  
     severity:   INFO   
     uuid:   b0be3a9f-5adc-4339-8e86-ca0f148290a3   
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am able to extract only the failed services ( &lt;CODE&gt;source="http:WebServiceCollector" logMessage="*Service failed*"&lt;/CODE&gt; ) and the finished services ( &lt;CODE&gt;source="http:WebServiceCollector" logMessage="*Service finished*"&lt;/CODE&gt;). But i am not able to create a chart that shows the number of finished and failed services group by service name.&lt;/P&gt;

&lt;P&gt;The search &lt;CODE&gt;source="http:WebServiceCollector" | chart count(eval(logMessage="*Service finished*")) as finished, count(eval(logMessage="*Service failed*")) as failed by serviceName"&lt;/CODE&gt; always returns 0 for finished and failed.&lt;/P&gt;

&lt;P&gt;Kind regards,&lt;BR /&gt;
Martin&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 11:03:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326130#M97238</guid>
      <dc:creator>martingawantka</dc:creator>
      <dc:date>2017-02-27T11:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to return a chart which counts failed and successful service executions and group by service name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326131#M97239</link>
      <description>&lt;P&gt;can you try: &lt;BR /&gt;
EDITED&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source="http:WebServiceCollector" |eval finished=if(logMessage="Service finished",1,0)|eval failed=if(logMessage="Service failed",1,0)| chart sum(finished) as finished sum(failed) as failed by serviceName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Feb 2017 14:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326131#M97239</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-02-27T14:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to return a chart which counts failed and successful service executions and group by service name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326132#M97240</link>
      <description>&lt;P&gt;I believe you want to use &lt;CODE&gt;sum(finished) and sum(failed)&lt;/CODE&gt; in the stats instead of &lt;CODE&gt;count&lt;/CODE&gt;. (or update &lt;CODE&gt;0&lt;/CODE&gt; with &lt;CODE&gt;null()&lt;/CODE&gt; in if conditions).&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 19:54:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326132#M97240</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-27T19:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to return a chart which counts failed and successful service executions and group by service name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326133#M97241</link>
      <description>&lt;P&gt;Thanks @somesoni2, I copied over the original syntax and forgot to change the counts.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 20:13:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326133#M97241</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-02-27T20:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to return a chart which counts failed and successful service executions and group by service name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326134#M97242</link>
      <description>&lt;P&gt;It is not working :-(.&lt;BR /&gt;
I think the search has a problem with the two "*" in the search (Unfortunately both * are missing in my first post.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;source="http:WebServiceCollector" |eval finished=if(logMessage="*Service failed*",1,0) | stats count(finished)&lt;/EM&gt; &lt;BR /&gt;
returns exactly the same value as &lt;BR /&gt;
&lt;EM&gt;source="http:WebServiceCollector" |eval finished=if(logMessage="*Service finished*",1,0) | stats count(finished)&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 08:02:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326134#M97242</guid>
      <dc:creator>martingawantka</dc:creator>
      <dc:date>2017-02-28T08:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to return a chart which counts failed and successful service executions and group by service name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326135#M97243</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source="http:WebServiceCollector" |eval finished=if(like(logMessage,"%Service finished%"),1,0)|eval failed=if(like(logMessage,"%Service failed%"),1,0)| chart sum(finished) as finished sum(failed) as failed by serviceName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Apr 2017 11:32:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326135#M97243</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-04-21T11:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to return a chart which counts failed and successful service executions and group by service name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326136#M97244</link>
      <description>&lt;P&gt;upvote because I prefer the "like"  syntax over the = with asterisks.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 14:46:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326136#M97244</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-04-21T14:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to return a chart which counts failed and successful service executions and group by service name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326137#M97245</link>
      <description>&lt;P&gt;Edited post to make the *'s show up in the sample code.  Basically, you need a space between an open parenthesis and the accent mark that marks the code sample.  (`)&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 14:48:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326137#M97245</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-04-21T14:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to return a chart which counts failed and successful service executions and group by service name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326138#M97246</link>
      <description>&lt;P&gt;This works perectly fine for me. Thank you very much.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 08:23:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326138#M97246</guid>
      <dc:creator>martingawantka</dc:creator>
      <dc:date>2017-04-28T08:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to return a chart which counts failed and successful service executions and group by service name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326139#M97247</link>
      <description>&lt;P&gt;If this answers your question, could you please accept it to finalize the question? Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 15:23:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-return-a-chart-which-counts-failed-and/m-p/326139#M97247</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-05-31T15:23:48Z</dc:date>
    </item>
  </channel>
</rss>

