<?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 String validation in chart eval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/String-validation-in-chart-eval/m-p/88803#M22738</link>
    <description>&lt;OL&gt;
&lt;LI&gt;For another query where I have to use not equal to in a query for string, even not equal to is not working properly in eval
There are 10 services with Success and failures, Consider as A, B ...J, 
for one service say B there is an error code 102, 103 &amp;amp; 104 (It is an error). If errorcode is 102 I want to add it to success so I used the query &lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;.. | chart count(eval(Status="Success" OR ServiceName="B" AND ErrorCode=102)) as "Success", count(eval(Status="Error" OR ServiceNameLookup="B" AND ErrorCode!=102)) as "Fail" by ServiceName&lt;/P&gt;

&lt;P&gt;This query counting 102 for both sucess &amp;amp; falures.&lt;/P&gt;

&lt;P&gt;Any suggetions for both please&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2013 19:49:39 GMT</pubDate>
    <dc:creator>marellasunil</dc:creator>
    <dc:date>2013-04-09T19:49:39Z</dc:date>
    <item>
      <title>String validation in chart eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/String-validation-in-chart-eval/m-p/88803#M22738</link>
      <description>&lt;OL&gt;
&lt;LI&gt;For another query where I have to use not equal to in a query for string, even not equal to is not working properly in eval
There are 10 services with Success and failures, Consider as A, B ...J, 
for one service say B there is an error code 102, 103 &amp;amp; 104 (It is an error). If errorcode is 102 I want to add it to success so I used the query &lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;.. | chart count(eval(Status="Success" OR ServiceName="B" AND ErrorCode=102)) as "Success", count(eval(Status="Error" OR ServiceNameLookup="B" AND ErrorCode!=102)) as "Fail" by ServiceName&lt;/P&gt;

&lt;P&gt;This query counting 102 for both sucess &amp;amp; falures.&lt;/P&gt;

&lt;P&gt;Any suggetions for both please&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 19:49:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/String-validation-in-chart-eval/m-p/88803#M22738</guid>
      <dc:creator>marellasunil</dc:creator>
      <dc:date>2013-04-09T19:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: String validation in chart eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/String-validation-in-chart-eval/m-p/88804#M22739</link>
      <description>&lt;P&gt;UPDATE (or rather a complete rewrite)&lt;/P&gt;

&lt;P&gt;It's too late in this TZ to do any clever thinking. Forget the previous attempt, and do like this instead;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | eval NewStat = if(errorcode=="102" AND service=="B", "success", status) | ...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This creates a temporary variable called &lt;CODE&gt;NewStat&lt;/CODE&gt; in each event, which will be set to 'success' if the errorcode=102 and the service=B, for all other events it will just copy the value of 'status'.&lt;/P&gt;

&lt;P&gt;Then you can use &lt;CODE&gt;NewStat&lt;/CODE&gt; for any further reporting, such as;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | chart c over service by NewStat&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2013 07:12:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/String-validation-in-chart-eval/m-p/88804#M22739</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-10T07:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: String validation in chart eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/String-validation-in-chart-eval/m-p/88805#M22740</link>
      <description>&lt;P&gt;Sorry, Kristian. That did't work. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; tried in several ways&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2013 19:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/String-validation-in-chart-eval/m-p/88805#M22740</guid>
      <dc:creator>marellasunil</dc:creator>
      <dc:date>2013-04-10T19:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: String validation in chart eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/String-validation-in-chart-eval/m-p/88806#M22741</link>
      <description>&lt;P&gt;see update above. tested and working.  /k&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 22:21:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/String-validation-in-chart-eval/m-p/88806#M22741</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-15T22:21:54Z</dc:date>
    </item>
  </channel>
</rss>

