<?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 group keys as column headers with aggregated values in a single row? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-group-keys-as-column-headers-with/m-p/239399#M71113</link>
    <description>&lt;P&gt;I have a search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="my_data"| stats count by queue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which aggregates data in a table by the field &lt;STRONG&gt;queue&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;It generates a table like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;queue     | count 
queue_one | 1234
queue_two | 7823
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(I've shown two rows in this result, but in practice, the number of rows may vary because I don't know what the aggregated keys will be in advance).&lt;/P&gt;

&lt;P&gt;How can I adjust my search so that the table shows aggregated keys as column headers which are also extracted fields, with a single row showing the counts, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;queue_one | queue_two 
1234      | 7823
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sorry, Splunk's Markdown page doesn't tell me how to create nicely formatted tables.&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/static/markdown/help.html"&gt;https://answers.splunk.com/static/markdown/help.html&lt;/A&gt; &lt;/P&gt;</description>
    <pubDate>Wed, 18 Nov 2015 17:34:59 GMT</pubDate>
    <dc:creator>track16</dc:creator>
    <dc:date>2015-11-18T17:34:59Z</dc:date>
    <item>
      <title>How to edit my search to group keys as column headers with aggregated values in a single row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-group-keys-as-column-headers-with/m-p/239399#M71113</link>
      <description>&lt;P&gt;I have a search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="my_data"| stats count by queue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which aggregates data in a table by the field &lt;STRONG&gt;queue&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;It generates a table like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;queue     | count 
queue_one | 1234
queue_two | 7823
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(I've shown two rows in this result, but in practice, the number of rows may vary because I don't know what the aggregated keys will be in advance).&lt;/P&gt;

&lt;P&gt;How can I adjust my search so that the table shows aggregated keys as column headers which are also extracted fields, with a single row showing the counts, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;queue_one | queue_two 
1234      | 7823
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sorry, Splunk's Markdown page doesn't tell me how to create nicely formatted tables.&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/static/markdown/help.html"&gt;https://answers.splunk.com/static/markdown/help.html&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 17:34:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-group-keys-as-column-headers-with/m-p/239399#M71113</guid>
      <dc:creator>track16</dc:creator>
      <dc:date>2015-11-18T17:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to group keys as column headers with aggregated values in a single row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-group-keys-as-column-headers-with/m-p/239400#M71114</link>
      <description>&lt;P&gt;Here's one way. There's probably a more elegant way..&lt;BR /&gt;
    ... | timechart limit=0 span=10y count by queue| fields - _time&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 17:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-group-keys-as-column-headers-with/m-p/239400#M71114</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-11-18T17:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to group keys as column headers with aggregated values in a single row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-group-keys-as-column-headers-with/m-p/239401#M71115</link>
      <description>&lt;P&gt;Thanks @sundareshr!&lt;/P&gt;

&lt;P&gt;I'm not supposed to use   &lt;CODE&gt;timechart&lt;/CODE&gt; in my Splunk installation (I believe for performance reasons). My admins tell me to use   &lt;CODE&gt;bucket&lt;/CODE&gt; and  &lt;CODE&gt;stats&lt;/CODE&gt; instead.&lt;/P&gt;

&lt;P&gt;Do you know if there is a way to do this with   &lt;CODE&gt;bucket&lt;/CODE&gt; and  &lt;CODE&gt;stats&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 18:08:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-group-keys-as-column-headers-with/m-p/239401#M71115</guid>
      <dc:creator>track16</dc:creator>
      <dc:date>2015-11-18T18:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to group keys as column headers with aggregated values in a single row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-group-keys-as-column-headers-with/m-p/239402#M71116</link>
      <description>&lt;P&gt;In that case, try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count by queue | untable queue field count | xyseries field queue count | fields - field
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Nov 2015 18:23:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-group-keys-as-column-headers-with/m-p/239402#M71116</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-11-18T18:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to group keys as column headers with aggregated values in a single row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-group-keys-as-column-headers-with/m-p/239403#M71117</link>
      <description>&lt;P&gt;Works great - thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 21:59:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-group-keys-as-column-headers-with/m-p/239403#M71117</guid>
      <dc:creator>track16</dc:creator>
      <dc:date>2015-11-18T21:59:40Z</dc:date>
    </item>
  </channel>
</rss>

