<?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 do I make a multi-dimension timechart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-a-multi-dimension-timechart/m-p/63666#M15722</link>
    <description>&lt;P&gt;Amazing answer. Kudos.&lt;/P&gt;</description>
    <pubDate>Tue, 18 Sep 2012 19:37:24 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2012-09-18T19:37:24Z</dc:date>
    <item>
      <title>How do I make a multi-dimension timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-a-multi-dimension-timechart/m-p/63664#M15720</link>
      <description>&lt;P&gt;I have a need to count up both failures and successes on a chart, split them by something, and then compare these values to the same time period in the past. Is it possible to do this all on one graph?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2012 16:22:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-a-multi-dimension-timechart/m-p/63664#M15720</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2012-09-18T16:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a multi-dimension timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-a-multi-dimension-timechart/m-p/63665#M15721</link>
      <description>&lt;P&gt;Yes. The search is a bit involved, and you will want to make sure the colors in the dashboard are set so you can clearly see current/previous times and types of failure/success messages.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Search&lt;/STRONG&gt;&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Get the events (successful and failure messages) that you are interested in.&lt;/LI&gt;
&lt;LI&gt;Round their times to a convenient time interval that is divisible by 3 (for "earlier period, later period, and blank" bars - see below)&lt;/LI&gt;
&lt;LI&gt;Differentiate the failure and success messages with a marker such as &lt;CODE&gt;type&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Count up the events by the category (in this case, &lt;CODE&gt;sourcetype&lt;/CODE&gt;) and success or failure (&lt;CODE&gt;type&lt;/CODE&gt;)&lt;/LI&gt;
&lt;LI&gt;Give this set of data a temporal marker, such as &lt;CODE&gt;period&lt;/CODE&gt;=today&lt;/LI&gt;
&lt;LI&gt;If the event is a failure message, negate the count&lt;/LI&gt;
&lt;LI&gt;Append a search that does the same as steps 1-6 above, over an earlier timeframe (specified in &lt;CODE&gt;earliest&lt;/CODE&gt; and &lt;CODE&gt;latest&lt;/CODE&gt;)&lt;/LI&gt;
&lt;LI&gt;At the end of the appended search, add the amount of time you went back to _time (in this example, went back an hour, so added 3600 seconds)&lt;/LI&gt;
&lt;LI&gt;Hack _time again to shift any &lt;CODE&gt;period&lt;/CODE&gt;=today events over 1/3 of the time period decided on in step 2&lt;/LI&gt;
&lt;LI&gt;Create a label using the time period, success/failure, and category fields to make a unique series to graph by&lt;/LI&gt;
&lt;LI&gt;Graph the series using a timechart using a span of 1/3 of the time period decided in step 2. This will leave every third one blank for clarity - to show the relationship between today and the previous period.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;example: run over &lt;CODE&gt;-h@&lt;/CODE&gt;&lt;CODE&gt;h&lt;/CODE&gt; to &lt;CODE&gt;@&lt;/CODE&gt;&lt;CODE&gt;h&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
index=_internal (sourcetype="splunkd" OR sourcetype="*_access" OR sourcetype="splunk_web_service" OR sourcetype="searches" OR sourcetype="scheduler") &lt;BR /&gt;
| bucket _time span=3m &lt;BR /&gt;
| eval type=if(searchmatch("sourcetype=splunkd OR sourcetype=splunkd_access OR sourcetype=scheduler"), "Successful", "Unsuccessful")&lt;BR /&gt;
| stats count by _time sourcetype type&lt;BR /&gt;
| eval period="Today" &lt;BR /&gt;
| eval count=if(type=="Successful", count, -1*count)&lt;BR /&gt;
| append&lt;BR /&gt;
   [search index=_internal (sourcetype="splunkd" OR sourcetype="*_access" OR sourcetype="splunk_web_service" OR sourcetype="searches" OR sourcetype="scheduler") &lt;BR /&gt;
 earliest=-2h@h latest=-h@h&lt;BR /&gt;
   | bucket _time span=3m&lt;BR /&gt;
   | eval type=if(searchmatch("sourcetype=splunkd OR sourcetype=splunkd_access OR sourcetype=scheduler"), "Successful", "Unsuccessful")&lt;BR /&gt;
   | stats count by _time sourcetype type&lt;BR /&gt;
   | eval period="Yesterday"&lt;BR /&gt;
   | eval count=if(type=="Successful", count, -1*count)&lt;BR /&gt;
   | eval _time=_time+3600]&lt;BR /&gt;
| eval _time=if(period=="Today", _time+60, _time) &lt;BR /&gt;
| eval series=type+" "+period+": "+sourcetype &lt;BR /&gt;
| timechart span=1m limit=12 first(count) as count by series&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Dashboard&lt;/STRONG&gt;&lt;BR /&gt;
Use a custom palette of colors to show the relationships clearly between current/previous and types of success/failure. Here's an example - this one uses blues/greens for success and reds/purples for failures, with 50% faded versions of the color for the previous period:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;chart&amp;gt;
  &amp;lt;searchName&amp;gt;Triple axis timechart - chart view&amp;lt;/searchName&amp;gt;
  &amp;lt;title&amp;gt;Triple Axis (success/failure, today/yesterday, sourcetype)&amp;lt;/title&amp;gt;
  &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.chart.stackMode"&amp;gt;stacked&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.legend.placement"&amp;gt;top&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.axisTitleX.text"&amp;gt;&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.axisTitleY.text"&amp;gt;Messages&amp;lt;/option&amp;gt;      
  &amp;lt;option name="charting.b1"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b1.color"&amp;gt;0x961C1C&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b1.alpha"&amp;gt;1.0&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b1t"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b1t.color"&amp;gt;0X961C1C&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b1t.alpha"&amp;gt;0.5&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b2"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b2.color"&amp;gt;0x961C89&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b2.alpha"&amp;gt;1.0&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b2t"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b2t.color"&amp;gt;0x961C89&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b2t.alpha"&amp;gt;0.5&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b3"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b3.color"&amp;gt;0xD41D3B&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b3.alpha"&amp;gt;1.0&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b3t"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b3t.color"&amp;gt;0xD41D3B&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b3t.alpha"&amp;gt;0.5&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b4"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b4.color"&amp;gt;0x519AEC&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b4.alpha"&amp;gt;1.0&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b4t"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b4t.color"&amp;gt;0X519AEC&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b4t.alpha"&amp;gt;0.5&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b5"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b5.color"&amp;gt;0x32B86B&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b5.alpha"&amp;gt;1.0&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b5t"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b5t.color"&amp;gt;0x32B86B&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b5t.alpha"&amp;gt;0.5&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b6"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b6.color"&amp;gt;0x4A68E7&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b6.alpha"&amp;gt;1.0&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b6t"&amp;gt;solidFill&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b6t.color"&amp;gt;0x4A68E7&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.b6t.alpha"&amp;gt;0.5&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.myBrushPalette"&amp;gt;list&amp;lt;/option&amp;gt;`
  &amp;lt;option name="charting.myBrushPalette.brushes"&amp;gt;[@b4,@b5,@b6,@b4t,@b5t,@b6t,@b1,@b2,@b3,@b1t,@b2t,@b3t]&amp;lt;/option&amp;gt;
  &amp;lt;option name="charting.chart.columnBrushPalette"&amp;gt;@myBrushPalette&amp;lt;/option&amp;gt;
&amp;lt;/chart&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Disclaimer&lt;/STRONG&gt;&lt;BR /&gt;
Using custom brushes to change colors, like above, is evidently not supported by JSchart, the HTML5 chart display mechanism. So... it's going to resort to flash.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Result&lt;/STRONG&gt;&lt;BR /&gt;
(click for full size photo!)&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://splunk-base.splunk.com/storage/tripleaxis.png" alt="Triple Axis Timechart" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2012 16:24:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-a-multi-dimension-timechart/m-p/63665#M15721</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2012-09-18T16:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a multi-dimension timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-a-multi-dimension-timechart/m-p/63666#M15722</link>
      <description>&lt;P&gt;Amazing answer. Kudos.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2012 19:37:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-a-multi-dimension-timechart/m-p/63666#M15722</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-09-18T19:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a multi-dimension timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-a-multi-dimension-timechart/m-p/63667#M15723</link>
      <description>&lt;P&gt;This is an excellent example of using the "advanced" charting features and brushes. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2012 20:46:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-a-multi-dimension-timechart/m-p/63667#M15723</guid>
      <dc:creator>justgrumpy</dc:creator>
      <dc:date>2012-09-19T20:46:57Z</dc:date>
    </item>
  </channel>
</rss>

