<?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: Can you help me with my xyseries custom sorting query? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455530#M167568</link>
    <description>&lt;P&gt;@shayhibah , updated the answer as there are no option for adding images in comments&lt;/P&gt;</description>
    <pubDate>Thu, 13 Sep 2018 10:02:06 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2018-09-13T10:02:06Z</dc:date>
    <item>
      <title>Can you help me with my xyseries custom sorting query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455522#M167560</link>
      <description>&lt;P&gt;I want the results of the following query to be sorted by orders I declare.&lt;BR /&gt;
For some reason, it does not work so I might missing something:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my_query | eval _time = time| bucket _time span=1d  | stats count by _time, app_risk | eval risk_order=case(app_risk=="Unknown",0, app_risk=="Very Low",1, app_risk=="Low",2, app_risk=="Medium",3, app_risk=="High",4, app_risk=="Critical",5) | sort -risk_order | xyseries _time,risk_order,count | rename "0" as "Unknown" "1" as "Very Low" "2" as "Low" "3" as "Medium" "4" as "High" "5" as "Critical"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Anyone?&lt;BR /&gt;
Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 05:49:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455522#M167560</guid>
      <dc:creator>shayhibah</dc:creator>
      <dc:date>2018-09-13T05:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my xyseries custom sorting query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455523#M167561</link>
      <description>&lt;P&gt;@shayhibah ,&lt;BR /&gt;
Created dummy series using &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_* earliest=-15m|eval app_risk=case(sourcetype="splunkd","Very Low",sourcetype="audittrail","Medium",sourcetype="kvstore","Low",sourcetype="splunkd_access","Critical",sourcetype="splunk_web_access","High")|search app_risk=*
|bucket span=5m _time|chart count over _time by app_risk| fields _time,Critical,High,Medium,Low,"Very Low"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Plotted on to a dashboard panel&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;testing&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;index=_* earliest=-15m|eval app_risk=case(sourcetype="splunkd","Very Low",sourcetype="audittrail","Medium",sourcetype="kvstore","Low",sourcetype="splunkd_access","Critical",sourcetype="splunk_web_access","High")|search app_risk=*
|bucket span=5m _time|chart count over _time by app_risk| fields _time,Critical,High,Medium,Low,"Very Low"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&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.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.scale"&amp;gt;linear&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.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;column&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;stacked&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.style"&amp;gt;minimal&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.placement"&amp;gt;right&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;

&lt;P&gt;And attached the dashboard I see&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/5753i307FDA7A18EC2113/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, 13 Sep 2018 09:59:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455523#M167561</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-09-13T09:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my xyseries custom sorting query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455524#M167562</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/100240"&gt;@shayhibah&lt;/a&gt; ,&lt;/P&gt;

&lt;P&gt;When you do an xyseries, the sorting could be done on first column which is _time in this case. risk_order or app_risk will be considered as column names and the count under them as values. For e.g.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;xyseries _time,risk_order,count&lt;/CODE&gt; will display as&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time 1 2 3 4 5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So if you need to sort by the column names, then you could mention them in &lt;CODE&gt;fields&lt;/CODE&gt;. For e.g. if you have defined number of  &lt;CODE&gt;app_risk&lt;/CODE&gt;, then try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my_query | eval _time = time| bucket _time span=1d | stats count by _time, app_risk
| xyseries _time,app_risk,count | fields _time,Critical,High,Medium,Low,"Very Low",Unknown
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:14:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455524#M167562</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-09-29T21:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my xyseries custom sorting query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455525#M167563</link>
      <description>&lt;P&gt;@renjith.nair&lt;/P&gt;

&lt;P&gt;Thanks for your response.&lt;BR /&gt;
What I am trying to do is to show all the data in stacked column but the order of the data should be by their risk - top will be critical and bottom will be unknown.&lt;/P&gt;

&lt;P&gt;I tried to do what you have suggested but it does not work.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 09:59:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455525#M167563</guid>
      <dc:creator>shayhibah</dc:creator>
      <dc:date>2018-09-13T09:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my xyseries custom sorting query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455526#M167564</link>
      <description>&lt;P&gt;@shayhibah ,okie got it, what about &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; my_query | eval _time = time| bucket _time span=1d
|chart count over _time by app_risk| fields _time,Critical,High,Medium,Low,"Very Low",Unknown
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also make sure your time format of &lt;CODE&gt;time&lt;/CODE&gt; is in epoch and if not convert it using strftime while assigning to _time&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 09:59:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455526#M167564</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-09-13T09:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my xyseries custom sorting query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455527#M167565</link>
      <description>&lt;P&gt;didnt help.. the xyseries command change the order of the columns&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 09:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455527#M167565</guid>
      <dc:creator>shayhibah</dc:creator>
      <dc:date>2018-09-13T09:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my xyseries custom sorting query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455528#M167566</link>
      <description>&lt;P&gt;@shayhibah , you don't need to use xyseries. The above search should serve your requirement.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 09:59:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455528#M167566</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-09-13T09:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my xyseries custom sorting query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455529#M167567</link>
      <description>&lt;P&gt;@renjith.nair&lt;/P&gt;

&lt;P&gt;When I run the query on search bar it looks good.&lt;BR /&gt;
When I create a panel - the order is changed.&lt;/P&gt;

&lt;P&gt;Do you know why? Maybe its because I used custom colors for the app_risk values?&lt;/P&gt;

&lt;P&gt;The current query is:&lt;/P&gt;

&lt;P&gt;my_query | eval _time = time| bucket _time span=1d&lt;BR /&gt;
 | chart count over _time by app_risk| fields _time,Critical,High,Medium,Low,"Very Low",Unknown&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:14:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455529#M167567</guid>
      <dc:creator>shayhibah</dc:creator>
      <dc:date>2020-09-29T21:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my xyseries custom sorting query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455530#M167568</link>
      <description>&lt;P&gt;@shayhibah , updated the answer as there are no option for adding images in comments&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 10:02:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455530#M167568</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-09-13T10:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my xyseries custom sorting query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455531#M167569</link>
      <description>&lt;P&gt;unfortunately it still does not work.&lt;BR /&gt;
I copied your query into the search bar - it looks fine.&lt;BR /&gt;
When I change the query in my dashboard source code - the visualization is different.&lt;/P&gt;

&lt;P&gt;Here is my code behind:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_* earliest=-15m|eval app_risk=case(sourcetype="splunkd","Very Low",sourcetype="audittrail","Medium",sourcetype="kvstore","Low",sourcetype="splunkd_access","Critical",sourcetype="splunk_web_access","High")|search app_risk=*
 |bucket span=5m _time|chart count over _time by app_risk| fields _time,Critical,High,Medium,Low,"Very Low"
          &amp;lt;earliest&amp;gt;$general_overview_time_picker.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$general_overview_time_picker.latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisTitleX.visibility"&amp;gt;collapsed&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY.text"&amp;gt;Logs&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.abbreviation"&amp;gt;auto&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.labels"&amp;gt;[Unknown,"Very Low",Low,Medium,High,Critical]&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;bottom&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.seriesColors"&amp;gt;[#A6A6A6,#6FA0F9,#89C73A,#FFE614,#FF8B1A,#E55D5D]&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.size"&amp;gt;small&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Sep 2018 11:59:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455531#M167569</guid>
      <dc:creator>shayhibah</dc:creator>
      <dc:date>2018-09-13T11:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my xyseries custom sorting query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455532#M167570</link>
      <description>&lt;P&gt;@shayhibah ,&lt;/P&gt;

&lt;P&gt;It's interesting &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; . can you just copy the full xml to your system and try. In b/w which version of splunk&amp;gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 12:54:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-my-xyseries-custom-sorting-query/m-p/455532#M167570</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-09-13T12:54:31Z</dc:date>
    </item>
  </channel>
</rss>

