<?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: Query results with field values as column header in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Query-results-with-field-values-as-column-header/m-p/62192#M15363</link>
    <description>&lt;P&gt;Given that you rename the 'Category(Cat)' and other fields to 'Cat' 'APP' and 'Desc' up front&lt;/P&gt;

&lt;P&gt;Join the "key" fields together first, like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval joined_fields=Cat.";".APP.";".Desc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then chart&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | chart count over joined_fields by Datacenter
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then add your totals&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | addtotals
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then split up the joined fields again&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=joined_fields "(?&amp;lt;Cat&amp;gt;.*?);(?&amp;lt;APP&amp;gt;.*?);(?&amp;lt;Desc&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Finally remove the joined_fields from the output&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | fields - joined_fields
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Dec 2012 11:40:19 GMT</pubDate>
    <dc:creator>jonuwz</dc:creator>
    <dc:date>2012-12-13T11:40:19Z</dc:date>
    <item>
      <title>Query results with field values as column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-results-with-field-values-as-column-header/m-p/62191#M15362</link>
      <description>&lt;P&gt;I have following fields&lt;BR /&gt;
Datacenter, Category(Cat ), Application(APP), Description(Desc).&lt;/P&gt;

&lt;P&gt;Datacenter has 10 or more possible values.&lt;/P&gt;

&lt;P&gt;Now i want a table like below&lt;/P&gt;

&lt;P&gt;First line is header where Datacenter_value1 .... Datacenter_valueN are values of field Datacenter and Count is sum of counts of each Datacenter_value column&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Count Datacenter_value1  Datacenter_value2 ..... Datacenter_valueN Cat APP Desc&lt;/STRONG&gt; &lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
450     5               23            .....   37      error cycle  frame error&lt;BR /&gt;&lt;BR /&gt;
565    16               43            .....   56      info  car    engine ready&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:57:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-results-with-field-values-as-column-header/m-p/62191#M15362</guid>
      <dc:creator>ma_anand1984</dc:creator>
      <dc:date>2020-09-28T12:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Query results with field values as column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-results-with-field-values-as-column-header/m-p/62192#M15363</link>
      <description>&lt;P&gt;Given that you rename the 'Category(Cat)' and other fields to 'Cat' 'APP' and 'Desc' up front&lt;/P&gt;

&lt;P&gt;Join the "key" fields together first, like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval joined_fields=Cat.";".APP.";".Desc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then chart&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | chart count over joined_fields by Datacenter
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then add your totals&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | addtotals
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then split up the joined fields again&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=joined_fields "(?&amp;lt;Cat&amp;gt;.*?);(?&amp;lt;APP&amp;gt;.*?);(?&amp;lt;Desc&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Finally remove the joined_fields from the output&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | fields - joined_fields
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Dec 2012 11:40:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-results-with-field-values-as-column-header/m-p/62192#M15363</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2012-12-13T11:40:19Z</dc:date>
    </item>
  </channel>
</rss>

