<?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: Change the Color  based on time in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460521#M30214</link>
    <description>&lt;P&gt;You need to pass _time in your transformation command to give it to chart against time. This can be done using &lt;CODE&gt;timechart&lt;/CODE&gt; or &lt;CODE&gt;stats by _time&lt;/CODE&gt;. You should also specify an index &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source="tcp:514" 
 | streamstats values(_raw) as value  
 | makemv value  
 | mvexpand value  
 | timechart count 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Aug 2019 14:22:39 GMT</pubDate>
    <dc:creator>skoelpin</dc:creator>
    <dc:date>2019-08-23T14:22:39Z</dc:date>
    <item>
      <title>Change the Color  based on time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460520#M30213</link>
      <description>&lt;P&gt;hi&lt;BR /&gt;
my dashboard plot event by time. i change the time to look like serial (see image) and i plot 2001 events.&lt;/P&gt;

&lt;P&gt;i want to paint by time, for example:&lt;BR /&gt;
serial 0-199 red.&lt;BR /&gt;
200-1000 blue.&lt;BR /&gt;
1001 2001 green.&lt;/P&gt;

&lt;P&gt;my search code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="tcp:514" 
| streamstats values(_raw) as value  
| makemv value  
| mvexpand value  
| search value&amp;lt;0
| streamstats count AS _time
| rename _time AS serial   
| table  serial value | head 2001
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my plot:&lt;BR /&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/7568i74BAC028C88A3744/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
thanks&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 13:08:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460520#M30213</guid>
      <dc:creator>erez10121012</dc:creator>
      <dc:date>2019-08-23T13:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Color  based on time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460521#M30214</link>
      <description>&lt;P&gt;You need to pass _time in your transformation command to give it to chart against time. This can be done using &lt;CODE&gt;timechart&lt;/CODE&gt; or &lt;CODE&gt;stats by _time&lt;/CODE&gt;. You should also specify an index &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source="tcp:514" 
 | streamstats values(_raw) as value  
 | makemv value  
 | mvexpand value  
 | timechart count 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Aug 2019 14:22:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460521#M30214</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2019-08-23T14:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Color  based on time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460522#M30215</link>
      <description>&lt;P&gt;@erez10121012 community would be able to assist you better if you can share some sample &lt;CODE&gt;_raw&lt;/CODE&gt; data values that you have. I am not able to understand why you would have to do streamstats --&amp;gt; makemv --&amp;gt; mvexpand --&amp;gt; then search filter?&lt;/P&gt;

&lt;P&gt;However, answering to your original question since you have to color the series based on sequence, try the following run anywhere example which generate 2000 negative values between &lt;CODE&gt;-80 to -89&lt;/CODE&gt; and then applied field color by creating series for 1-200, 201-1000 and 1001-2000 as Red, Blue and Green respectively.&lt;/P&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/7567i49050BC9C6C1B835/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Following is the Simple XML code for run anywhere example.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Chart with Color based on Sequence&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults count=2000 
| fields - _time 
| streamstats count AS series 
| eval series=printf("%05d",series) 
| eval value=random(), value="-8".substr(value,1,1)
| eval series1=case(series&amp;gt;=1 AND series&amp;lt;200,"1-199 (Red)",
    series&amp;gt;=201 AND series&amp;lt;1000,"201-999 (Blue)",
    series&amp;gt;=1001 AND series&amp;lt;2000,"1001-1999 (Green)") 
| xyseries series series1 value&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.fieldColors"&amp;gt;{"1-199 (Red)":0xDC4E41,"201-999 (Blue)":0x006D9C,"1001-1999 (Green)":0x53A051}&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.overflowMode"&amp;gt;ellipsisNone&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.rotation"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleX.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY2.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisX.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisX.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.scale"&amp;gt;inherit&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;line&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMaximumSize"&amp;gt;50&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMinimumSize"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleSizeBy"&amp;gt;area&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.showDataLabels"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.sliceCollapsingThreshold"&amp;gt;0.01&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.stackMode"&amp;gt;default&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.style"&amp;gt;shiny&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries.allowIndependentYRanges"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.labelStyle.overflowMode"&amp;gt;ellipsisMiddle&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.mode"&amp;gt;standard&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;right&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.lineWidth"&amp;gt;2&amp;lt;/option&amp;gt;
        &amp;lt;option name="height"&amp;gt;369&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.scales.shared"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.size"&amp;gt;medium&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Aug 2019 15:15:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460522#M30215</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-08-23T15:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Color  based on time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460523#M30216</link>
      <description>&lt;P&gt;thank for the help @ niketnilay&lt;BR /&gt;
my raw data array of bytes sent from the client to spunk.&lt;BR /&gt;
i receive the  2001 in one event. {-78 -79 -55 -60 ...}&lt;BR /&gt;
to plot the data i must to do mvexpand.&lt;/P&gt;

&lt;P&gt;about the flow "streamstats --&amp;gt; makemv --&amp;gt; mvexpand --&amp;gt; then search filter"&lt;BR /&gt;
i dont know exactly why i do it like that, but if you can tell me A rule of thumb what the right order, i would be very grateful to you.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2019 05:23:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460523#M30216</guid>
      <dc:creator>erez10121012</dc:creator>
      <dc:date>2019-08-25T05:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Color  based on time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460524#M30217</link>
      <description>&lt;P&gt;You may have to check search performance in your stack with ample data. However, instead of &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | streamstats values(_raw) as value  
 | makemv value  
 | mvexpand value  
 | search value&amp;lt;0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try the following: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makemv _raw
| eval _raw=mvfilter(_raw&amp;lt;0)
| rename _raw as data 
| mvexpand data
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Remaining sample query I have already provided in the example above. If your issue is resolved do accept the answer and up-vote the answer/comment that helped!&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2019 19:15:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460524#M30217</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-08-25T19:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Color  based on time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460525#M30218</link>
      <description>&lt;P&gt;thanks @niketnilay it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="tcp:514"
    | streamstats values(_raw) as value
    | makemv value
    | mvexpand value
    | search value&amp;amp;lt;0
    | rename _time AS series | fields - _time
    | streamstats count AS series
    | eval series=printf("%05d",series)
    | eval series1=case(
    series&amp;amp;gt;=0 AND series&amp;amp;lt;130,"Anomaly (Black)",
    series&amp;amp;gt;=131 AND series&amp;amp;lt;250,"Cell (Blue)",
    series&amp;amp;gt;=250 AND series&amp;amp;lt;999,"Anomaly (Black)",
    series&amp;amp;gt;=1000 AND series&amp;amp;lt;1100,"Cell (Green)",
    series&amp;amp;gt;=1101 AND series&amp;amp;lt;1499,"Anomaly (Black)",
    series&amp;amp;gt;=1550 AND series&amp;amp;lt;1650,"WIFI (Red)",
    series&amp;amp;gt;=1651 AND series&amp;amp;lt;2001,"Anomaly (Black)")
    | xyseries series series1 value| head 2001&amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Aug 2019 05:38:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460525#M30218</guid>
      <dc:creator>erez10121012</dc:creator>
      <dc:date>2019-08-26T05:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Color  based on time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460526#M30219</link>
      <description>&lt;P&gt;Great. How about the suggestion in your previous query. Did you try the following and compared performance of your current and the new query using Job Inspector?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | makemv _raw
 | eval _raw=mvfilter(_raw&amp;lt;0)
 | rename _raw as data 
 | mvexpand data
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Aug 2019 05:46:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-the-Color-based-on-time/m-p/460526#M30219</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-08-26T05:46:58Z</dc:date>
    </item>
  </channel>
</rss>

