<?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: Timechart Cell value replace numeric value by conditional string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Cell-value-replace-numeric-value-by-conditional-string/m-p/235202#M69861</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt;|untable _time activityName response_health|eval color=case(response_health==0 AND response_health&amp;lt;7,"Green",response_health&amp;gt; 6 AND response_health&amp;lt;21,"Amber" ,1=1,"Red")|xyseries _time activityName color
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Instead of 1=1, you can provide response_heath&amp;gt;20 and give another default value in case the other three conditions are not matched.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jan 2016 05:03:55 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2016-01-18T05:03:55Z</dc:date>
    <item>
      <title>Timechart Cell value replace numeric value by conditional string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Cell-value-replace-numeric-value-by-conditional-string/m-p/235201#M69860</link>
      <description>&lt;P&gt;Hi All, i am newbie to Splunk and need an assistance in writing a splunk dashboard where i wish to replace the average transaction duration value with a range string. For eg. if the Transaction duration is between 0-6 sec, rather then displaying an actual average duration (number)  it should display a text "Green".&lt;/P&gt;

&lt;P&gt;Condition : 0-6 Green , 7-20 Amber, &amp;gt;20 Red&lt;/P&gt;

&lt;P&gt;Draft Query is given below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XXX_XXX  sourcetype=XXX_YYY source=YXYX_YCYC 
Search String 
| transaction correlationId keepevicted=true 
| timechart span=5m avg(duration) as response_health by activityName
| convert ctime(_time) as _time timeformat="%H:%M %p"  
| fillnull 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&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/968iBD473C0625FB39A2/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>Mon, 18 Jan 2016 02:24:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Cell-value-replace-numeric-value-by-conditional-string/m-p/235201#M69860</guid>
      <dc:creator>rishiaggarwal</dc:creator>
      <dc:date>2016-01-18T02:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Cell value replace numeric value by conditional string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Cell-value-replace-numeric-value-by-conditional-string/m-p/235202#M69861</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt;|untable _time activityName response_health|eval color=case(response_health==0 AND response_health&amp;lt;7,"Green",response_health&amp;gt; 6 AND response_health&amp;lt;21,"Amber" ,1=1,"Red")|xyseries _time activityName color
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Instead of 1=1, you can provide response_heath&amp;gt;20 and give another default value in case the other three conditions are not matched.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 05:03:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Cell-value-replace-numeric-value-by-conditional-string/m-p/235202#M69861</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-01-18T05:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Cell value replace numeric value by conditional string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Cell-value-replace-numeric-value-by-conditional-string/m-p/235203#M69862</link>
      <description>&lt;P&gt;Thanks a heap. This solution worked for me.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 06:37:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Cell-value-replace-numeric-value-by-conditional-string/m-p/235203#M69862</guid>
      <dc:creator>rishiaggarwal</dc:creator>
      <dc:date>2016-01-18T06:37:45Z</dc:date>
    </item>
  </channel>
</rss>

