<?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 to maintain the exact sequence of columns in chart in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289572#M18365</link>
    <description>&lt;P&gt;Seems like a good idea but this gives no output&lt;/P&gt;</description>
    <pubDate>Mon, 27 Mar 2017 18:50:02 GMT</pubDate>
    <dc:creator>pal4life</dc:creator>
    <dc:date>2017-03-27T18:50:02Z</dc:date>
    <item>
      <title>How to maintain the exact sequence of columns in chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289568#M18361</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I currently have this query&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;source="Splunk-dat-Month-CHML.csv" host="splunk.engine.host" index="security" sourcetype="csv"|  table _time, high, medium, low | untable _time severity value| chart first(value) over _time by severity&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;But for some reason when the chart is drawn, it shows me a bar chart with high then low then medium on it, how can I ensure it maintains the sequence of high, medium and low?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 15:20:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289568#M18361</guid>
      <dc:creator>pal4life</dc:creator>
      <dc:date>2017-03-27T15:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to maintain the exact sequence of columns in chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289569#M18362</link>
      <description>&lt;P&gt;If the field names are static, you could just add your table command at the end as well.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="Splunk-dat-Month-CHML.csv" host="splunk.engine.host" index="security" sourcetype="csv"| table _time, high, medium, low | untable _time severity value| chart first(value) over _time by severity | table _time, high, medium, low
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After chart/timechart/xyseries type of commands fields name are sorted alphabatically (H,L,M). One workaround would be to add a numeric seq number to field names so that they are sorted numerically and retain their order.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="Splunk-dat-Month-CHML.csv" host="splunk.engine.host" index="security" sourcetype="csv"| table _time, high, medium, low | untable _time severity value | streamstats count as sno by _time | eval severity=sno.".".severity | chart first(value) over _time by severity 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2017 15:25:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289569#M18362</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-27T15:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to maintain the exact sequence of columns in chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289570#M18363</link>
      <description>&lt;P&gt;Charts are sorted using the fields following the "by".  "high, low, medium" is an alphabetic sort. Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="Splunk-dat-Month-CHML.csv" host="splunk.engine.host" index="security" sourcetype="csv"
| untable _time severity value
| eval severity_sorter = case(severity=="high",3, severity=="medium",2, severity=="low",1,1==1,0)
| chart first(value) by _time severity_sorter
| rename "1" as Low "2" as "Medium" "3" as "High"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2017 15:31:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289570#M18363</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2017-03-27T15:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to maintain the exact sequence of columns in chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289571#M18364</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source="Splunk-dat-Month-CHML.csv" host="splunk.engine.host" index="security" sourcetype="csv"
| table _time high medium low
| rename high AS "  high" medium AS " medium"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that &lt;CODE&gt;high&lt;/CODE&gt; has been renamed with 2 leading spaces and &lt;CODE&gt;medium&lt;/CODE&gt; with just one (and &lt;CODE&gt;low&lt;/CODE&gt; not at all).&lt;BR /&gt;
The whitespace is invisible in the chart but forces the alphabetical order that you desire.&lt;BR /&gt;
I do not think that you need the &lt;CODE&gt;untable -&amp;gt; rechart&lt;/CODE&gt; because I am assuming that you did that in an attempt to re-order the fields but if you need it to coalesce values or times, then just add it back in.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 17:12:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289571#M18364</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-27T17:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to maintain the exact sequence of columns in chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289572#M18365</link>
      <description>&lt;P&gt;Seems like a good idea but this gives no output&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 18:50:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289572#M18365</guid>
      <dc:creator>pal4life</dc:creator>
      <dc:date>2017-03-27T18:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to maintain the exact sequence of columns in chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289573#M18366</link>
      <description>&lt;P&gt;The first one worked for me, I will try the 2nd option as well.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 18:51:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289573#M18366</guid>
      <dc:creator>pal4life</dc:creator>
      <dc:date>2017-03-27T18:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to maintain the exact sequence of columns in chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289574#M18367</link>
      <description>&lt;P&gt;Hey, you forgot to test mine; it works and is the simplest.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 18:56:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289574#M18367</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-27T18:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to maintain the exact sequence of columns in chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289575#M18368</link>
      <description>&lt;P&gt;Underscore missing on &lt;CODE&gt;_time&lt;/CODE&gt; was the reason for no data.  Unfortunately, the &lt;CODE&gt;rename&lt;/CODE&gt; reorders the fields, so you have to use either somesoni2's method (append numeric) or woodcock's (append spaces).&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 16:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289575#M18368</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-17T16:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to maintain the exact sequence of columns in chart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289576#M18369</link>
      <description>&lt;P&gt;I like it, for small number of fields.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 17:00:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-maintain-the-exact-sequence-of-columns-in-chart/m-p/289576#M18369</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-17T17:00:13Z</dc:date>
    </item>
  </channel>
</rss>

