<?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 How to edit my search to reformat columns to rows and rows to columns for my resulting table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-reformat-columns-to-rows-and-rows-to/m-p/264229#M79332</link>
    <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I have this search below, which produces results, but need to format these in a report.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=imdc_w sourcetype="imdp:ITSM:changes"                        
|rename assignment_group as Assignmentgroup, u_chg_plan_impl_startdate as Time u_chg_reject_count as Reject_count ,u_chg_exped as Expedited, u_chg_unauthorized as Unauthorized, u_chg_plan_impl_stopdate as stopdate, closed_at as closeddate 
| where Assignmentgroup != "assignment_group"  
| join type=left Assignmentgroup [  |inputlookup sys_user_group.csv]  
| eval Platform=if(isnull(Platform), "Unknown Platform", Platform) 
| eval Tier=if(isnull(Tier), "L2", Tier) 
|search Tier=* 
| search Platform="*" 
| search Director="*" 
| search Assignmentgroup="*" 
| search VP="*"  
| eval type = if (type="Service Restore Emergency", number, null())   
| eval Reject_count = if(Reject_count&amp;gt;0 AND state="Closed", number, null())  
|eval Expedited=if(Expedited="true",number,null())  
|eval Unsuccessful=if(u_chg_closure_code ="Unsuccessful",number,null()) 
|dedup change_request 
|stats dc(type) as Emergency dc(Reject_count) as Rejected dc(Expedited) as Expedited dc(Unauthorized) as Unauthorized dc(Unsuccessful) as Unsuccessful dc(change_request) as Total  by date_month
|xyseries date_month 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Currently result output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date_month    Emergency    Rejected    Unauthorized    Unsuccessful
Aug           0            0           2               3
Jul           1            2           2               1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to see results in below format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;                 Aug     Jul     Jun
Emergency        0       0       0
Rejected         2       1       0
Unauthorized     0       0       3
Unsuccessful
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please help?&lt;/P&gt;

&lt;P&gt;THanks&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2016 17:03:17 GMT</pubDate>
    <dc:creator>splunker9999</dc:creator>
    <dc:date>2016-09-01T17:03:17Z</dc:date>
    <item>
      <title>How to edit my search to reformat columns to rows and rows to columns for my resulting table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-reformat-columns-to-rows-and-rows-to/m-p/264229#M79332</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I have this search below, which produces results, but need to format these in a report.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=imdc_w sourcetype="imdp:ITSM:changes"                        
|rename assignment_group as Assignmentgroup, u_chg_plan_impl_startdate as Time u_chg_reject_count as Reject_count ,u_chg_exped as Expedited, u_chg_unauthorized as Unauthorized, u_chg_plan_impl_stopdate as stopdate, closed_at as closeddate 
| where Assignmentgroup != "assignment_group"  
| join type=left Assignmentgroup [  |inputlookup sys_user_group.csv]  
| eval Platform=if(isnull(Platform), "Unknown Platform", Platform) 
| eval Tier=if(isnull(Tier), "L2", Tier) 
|search Tier=* 
| search Platform="*" 
| search Director="*" 
| search Assignmentgroup="*" 
| search VP="*"  
| eval type = if (type="Service Restore Emergency", number, null())   
| eval Reject_count = if(Reject_count&amp;gt;0 AND state="Closed", number, null())  
|eval Expedited=if(Expedited="true",number,null())  
|eval Unsuccessful=if(u_chg_closure_code ="Unsuccessful",number,null()) 
|dedup change_request 
|stats dc(type) as Emergency dc(Reject_count) as Rejected dc(Expedited) as Expedited dc(Unauthorized) as Unauthorized dc(Unsuccessful) as Unsuccessful dc(change_request) as Total  by date_month
|xyseries date_month 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Currently result output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date_month    Emergency    Rejected    Unauthorized    Unsuccessful
Aug           0            0           2               3
Jul           1            2           2               1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to see results in below format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;                 Aug     Jul     Jun
Emergency        0       0       0
Rejected         2       1       0
Unauthorized     0       0       3
Unsuccessful
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please help?&lt;/P&gt;

&lt;P&gt;THanks&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 17:03:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-reformat-columns-to-rows-and-rows-to/m-p/264229#M79332</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2016-09-01T17:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to reformat columns to rows and rows to columns for my resulting table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-reformat-columns-to-rows-and-rows-to/m-p/264230#M79333</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=imdc_w sourcetype="imdp:ITSM:changes"  
| rename assignment_group as Assignmentgroup, u_chg_plan_impl_startdate as Time u_chg_reject_count as Reject_count ,u_chg_exped as Expedited, u_chg_unauthorized as Unauthorized, u_chg_plan_impl_stopdate as stopdate, closed_at as closeddate  
| where Assignmentgroup != "assignment_group" 
| join type=left Assignmentgroup [  |inputlookup sys_user_group.csv] 
| eval Platform=if(isnull(Platform), "Unknown Platform", Platform)  
| eval Tier=if(isnull(Tier), "L2", Tier) 
| search Tier=* 
| search Platform="*" 
| search Director="*" 
| search Assignmentgroup="*" 
| search VP="*"  
| eval type = if (type="Service Restore Emergency", number, null())  
| eval Reject_count = if(Reject_count&amp;gt;0 AND state="Closed", number, null())   
| eval Expedited=if(Expedited="true",number,null())   
| eval Unsuccessful=if(u_chg_closure_code ="Unsuccessful",number,null()) 
| dedup change_request   
| stats dc(type) as Emergency dc(Reject_count) as Rejected dc(Expedited) as Expedited dc(Unauthorized) as Unauthorized dc(Unsuccessful) as Unsuccessful dc(change_request) as Total  by date_month
| untable date_month groups count 
| xyseries groups date_month count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Sep 2016 17:09:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-reformat-columns-to-rows-and-rows-to/m-p/264230#M79333</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-01T17:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to reformat columns to rows and rows to columns for my resulting table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-reformat-columns-to-rows-and-rows-to/m-p/264231#M79334</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;How can I order results by month instead by alphabetical order.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=imdc_w sourcetype="imdp:ITSM:changes"                        |rename assignment_group as Assignmentgroup, u_chg_plan_impl_startdate as Time u_chg_reject_count as Reject_count ,u_chg_exped as Expedited, u_chg_unauthorized as Unauthorized, u_chg_plan_impl_stopdate as stopdate, closed_at as closeddate                           | where Assignmentgroup != "assignment_group"                     | join type=left Assignmentgroup [  |inputlookup sys_user_group.csv]                | eval Platform=if(isnull(Platform), "Unknown Platform", Platform)                     | eval Tier=if(isnull(Tier), "L2", Tier) |search Tier=*                      | search Platform="*" | search Director="*" | search Assignmentgroup="*" | search VP="Kevin L Murray"                  | eval type = if (type="Service Restore Emergency", number, null())              | eval Reject_count = if(Reject_count&amp;gt;0 AND state="Closed", number, null())                  |eval Expedited=if(Expedited="true",number,null())      |eval Unsuccessful=if(u_chg_closure_code ="Unsuccessful",number,null())       |dedup change_request                   |stats dc(type) as Emergency dc(Reject_count) as Rejected dc(Expedited) as Expedited dc(Unauthorized) as Unauthorized dc(Unsuccessful) as Failed dc(change_request) as "Total   Requested" by date_month|rename date_month as Month|replace august with Aug july with Jul june with Jun may with May april with Apr march with Mar febrauary with Feb january with Jan september with Sep october with October november with Nov december with Dec
| untable Month groups count | xyseries groups Month count|addtotals fieldname=YTD|rename groups as " "
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Sep 2016 17:37:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-reformat-columns-to-rows-and-rows-to/m-p/264231#M79334</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2016-09-01T17:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to reformat columns to rows and rows to columns for my resulting table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-reformat-columns-to-rows-and-rows-to/m-p/264232#M79335</link>
      <description>&lt;P&gt;See if this works&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=imdc_w sourcetype="imdp:ITSM:changes"                        
| rename assignment_group as Assignmentgroup, u_chg_plan_impl_startdate as Time u_chg_reject_count as Reject_count ,u_chg_exped as Expedited, u_chg_unauthorized as Unauthorized, u_chg_plan_impl_stopdate as stopdate, closed_at as closeddate                           
| where Assignmentgroup != "assignment_group"                     
| join type=left Assignmentgroup
    [  
    | inputlookup sys_user_group.csv]                
| eval Platform=if(isnull(Platform), "Unknown Platform", Platform)                     
| eval Tier=if(isnull(Tier), "L2", Tier) 
| search Tier=*                      
| search Platform="*" 
| search Director="*" 
| search Assignmentgroup="*" 
| search VP="Kevin L Murray"                  
| eval type = if (type="Service Restore Emergency", number, null())              
| eval Reject_count = if(Reject_count&amp;gt;0 AND state="Closed", number, null())                  
| eval Expedited=if(Expedited="true",number,null())      
| eval Unsuccessful=if(u_chg_closure_code ="Unsuccessful",number,null())       
| dedup change_request                   
| eval Month=strftime(_time, "%m-%b%)
| stats dc(type) as Emergency dc(Reject_count) as Rejected dc(Expedited) as Expedited dc(Unauthorized) as Unauthorized dc(Unsuccessful) as Failed dc(change_request) as "Total   Requested" by Month
| untable Month groups count 
| xyseries groups Month count
| addtotals fieldname=YTD
| rename groups as " "
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Sep 2016 17:44:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-reformat-columns-to-rows-and-rows-to/m-p/264232#M79335</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-01T17:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to reformat columns to rows and rows to columns for my resulting table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-reformat-columns-to-rows-and-rows-to/m-p/264233#M79336</link>
      <description>&lt;P&gt;You can probably also remove &lt;CODE&gt;|search Tier=* &lt;BR /&gt;
 | search Platform="*"&lt;/CODE&gt; because those fields will always have a value, given the prior evals for them.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 17:54:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-reformat-columns-to-rows-and-rows-to/m-p/264233#M79336</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2016-09-01T17:54:43Z</dc:date>
    </item>
  </channel>
</rss>

