<?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 sort chart columns where the column headers are field values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-chart-columns-where-the-column-headers-are-field/m-p/149054#M41645</link>
    <description>&lt;P&gt;Assuming that &lt;CODE&gt;FAILURE&lt;/CODE&gt; is a value of field &lt;CODE&gt;job_status&lt;/CODE&gt; then your statement is incorrect.  Using chart the way you show will cause a column (field) to be created named &lt;CODE&gt;FAILURE&lt;/CODE&gt; so you should be able to do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ko_autosys sourcetype=autosys_applog_scheduler_events host="usatlb98" OR host="usatlb91" System="*" JOB_NAME="*" eventtype=autosys_failure_jobs OR eventtype=autosys_terminated_jobs OR eventtype=autosys_restart_jobs OR eventtype=autosys_success_jobs | chart  count(JOB_NAME) over System by job_status | sort 0 -FAILURE
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 30 Jul 2015 15:51:13 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-07-30T15:51:13Z</dc:date>
    <item>
      <title>How to sort chart columns where the column headers are field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-chart-columns-where-the-column-headers-are-field/m-p/149053#M41644</link>
      <description>&lt;P&gt;I have the following search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ko_autosys sourcetype=autosys_applog_scheduler_events  host="usatlb98" OR host="usatlb91" System="*"  JOB_NAME="*" eventtype=autosys_failure_jobs OR eventtype=autosys_terminated_jobs OR eventtype=autosys_restart_jobs OR eventtype=autosys_success_jobs  |chart  count(JOB_NAME) over System by job_status 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It displays a table with the following columns: System, FAILURE, RESTART, TERMINATED, SUCCESS&lt;/P&gt;

&lt;P&gt;I want to sort by the FAILURE Column where the System with the largest number of failures is on top. The issue is that FAILURE SUCCESS TERMINATED and RESTART are field values, not field names.&lt;/P&gt;

&lt;P&gt;Please help. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 23:43:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-chart-columns-where-the-column-headers-are-field/m-p/149053#M41644</guid>
      <dc:creator>zd00191</dc:creator>
      <dc:date>2015-07-29T23:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort chart columns where the column headers are field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-chart-columns-where-the-column-headers-are-field/m-p/149054#M41645</link>
      <description>&lt;P&gt;Assuming that &lt;CODE&gt;FAILURE&lt;/CODE&gt; is a value of field &lt;CODE&gt;job_status&lt;/CODE&gt; then your statement is incorrect.  Using chart the way you show will cause a column (field) to be created named &lt;CODE&gt;FAILURE&lt;/CODE&gt; so you should be able to do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ko_autosys sourcetype=autosys_applog_scheduler_events host="usatlb98" OR host="usatlb91" System="*" JOB_NAME="*" eventtype=autosys_failure_jobs OR eventtype=autosys_terminated_jobs OR eventtype=autosys_restart_jobs OR eventtype=autosys_success_jobs | chart  count(JOB_NAME) over System by job_status | sort 0 -FAILURE
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jul 2015 15:51:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-chart-columns-where-the-column-headers-are-field/m-p/149054#M41645</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-30T15:51:13Z</dc:date>
    </item>
  </channel>
</rss>

