<?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: Aliasing and Graphing events at search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219599#M64530</link>
    <description>&lt;P&gt;Since Hiroshi beat me to it with eval, for completeness here is how you can do it with foreach &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype= mydata 
| stats count by status 
| foreach status [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = if((&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=="FAIL" OR &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=="FAILURE"),"FAILED",&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;) ] 
| stats sum(count) as count by status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Foreach"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Foreach&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2017 09:32:53 GMT</pubDate>
    <dc:creator>jplumsdaine22</dc:creator>
    <dc:date>2017-01-05T09:32:53Z</dc:date>
    <item>
      <title>Aliasing and Graphing events at search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219597#M64528</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Apologies if this is too simple question and has been asked 100 times, But i can't seem to find the answer I'm looking for..&lt;/P&gt;

&lt;P&gt;For the time being, I simply want to graph the number transaction status over time from a sourcetype which shows the following: "SUCCESS" "FAILED", "BLOCKED"...&lt;/P&gt;

&lt;P&gt;However, for failed transactions, the data is coming in with failed status= "FAIL" or "FAILURE".&lt;/P&gt;

&lt;P&gt;How can I make "FAILED = FAIL + FAILURE", and plot the status = SUCCESS &amp;amp; status = BLOCKED along side it?&lt;/P&gt;

&lt;P&gt;I'm currently using the search: &lt;BR /&gt;
sourcetype= mydata | stats count by status&lt;/P&gt;

&lt;P&gt;As per below:&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Craig&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2292iCCF3EBB84488F6CB/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 04:38:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219597#M64528</guid>
      <dc:creator>craigwilkinson</dc:creator>
      <dc:date>2017-01-05T04:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Aliasing and Graphing events at search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219598#M64529</link>
      <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;P&gt;sourcetype= mydata|eval status=if(status="FAIL" OR status="FAILER","FAILED",status) | stats count by status&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 09:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219598#M64529</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2017-01-05T09:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Aliasing and Graphing events at search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219599#M64530</link>
      <description>&lt;P&gt;Since Hiroshi beat me to it with eval, for completeness here is how you can do it with foreach &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype= mydata 
| stats count by status 
| foreach status [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = if((&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=="FAIL" OR &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=="FAILURE"),"FAILED",&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;) ] 
| stats sum(count) as count by status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Foreach"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Foreach&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 09:32:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219599#M64530</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2017-01-05T09:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Aliasing and Graphing events at search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219600#M64531</link>
      <description>&lt;P&gt;Beat me to it!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 09:33:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219600#M64531</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2017-01-05T09:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Aliasing and Graphing events at search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219601#M64532</link>
      <description>&lt;P&gt;Awesome, thanks guys &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 23:27:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219601#M64532</guid>
      <dc:creator>craigwilkinson</dc:creator>
      <dc:date>2017-01-05T23:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Aliasing and Graphing events at search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219602#M64533</link>
      <description>&lt;P&gt;Thanks for the reply mate.&lt;/P&gt;

&lt;P&gt;Interested to investigate this method a little further,&lt;/P&gt;

&lt;P&gt;When I run your command, it doesn't seem to return any results :s&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 23:31:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219602#M64533</guid>
      <dc:creator>craigwilkinson</dc:creator>
      <dc:date>2017-01-05T23:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Aliasing and Graphing events at search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219603#M64534</link>
      <description>&lt;P&gt;interesting - it definately should!&lt;/P&gt;

&lt;P&gt;Here's a run anywhere example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|gentimes start=-1
| eval status="FAIL"
| stats count by status
 | foreach status [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = if((&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=="FAIL" OR &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=="FAILURE"),"FAILED",&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;) ] 
 | stats sum(count) as count by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jan 2017 13:38:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Aliasing-and-Graphing-events-at-search/m-p/219603#M64534</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2017-01-06T13:38:00Z</dc:date>
    </item>
  </channel>
</rss>

