<?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 transforming table output in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/transforming-table-output/m-p/34471#M7435</link>
    <description>&lt;P&gt;I have a summary index of stats in hourly buckets. I need to caculate rolled up stats for these. &lt;BR /&gt;
The hourly stats are count, median duration, max duration.&lt;BR /&gt;
The rollups are total count, avg median duration, max duration per day (also need for month etc)&lt;/P&gt;

&lt;P&gt;The end result looks like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;txnType   metricName                result
A         Volume                    356
A         AverageMedianDuration     300
A         MaximumDuration           400
B         Volume                    1
B         AverageMedianDuration     902
B         MaximumDuration           1200
C         Volume                    292
C         AverageMedianDuration     1000
C         MaximumDuration           2000
D         Volume                    9439
D         Average Median duration   3000
D         Max Duration              4000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Currently I have been doing separate queries for each metric (i.e. 3 queries). But as they all roll up over the same period I'm hoping to reduce that to one query. The start of the query looks like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... | stats sum(Volume) as Volume, avg(MedianDuration) as AverageMedianDuration, max(MaximumDuration) as MaximumDuration by txnType
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which gives a result like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;txnType Volume  AverageMedianDuration   MaximumDuration
A       356     300                     400
B       1       902                     1200
C       292     1000                    2000
D       9439    3000                    4000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas on how to transform this into the desired format? I guess this is like an unpivot&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2011 00:39:30 GMT</pubDate>
    <dc:creator>andersmholmgren</dc:creator>
    <dc:date>2011-12-14T00:39:30Z</dc:date>
    <item>
      <title>transforming table output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transforming-table-output/m-p/34471#M7435</link>
      <description>&lt;P&gt;I have a summary index of stats in hourly buckets. I need to caculate rolled up stats for these. &lt;BR /&gt;
The hourly stats are count, median duration, max duration.&lt;BR /&gt;
The rollups are total count, avg median duration, max duration per day (also need for month etc)&lt;/P&gt;

&lt;P&gt;The end result looks like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;txnType   metricName                result
A         Volume                    356
A         AverageMedianDuration     300
A         MaximumDuration           400
B         Volume                    1
B         AverageMedianDuration     902
B         MaximumDuration           1200
C         Volume                    292
C         AverageMedianDuration     1000
C         MaximumDuration           2000
D         Volume                    9439
D         Average Median duration   3000
D         Max Duration              4000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Currently I have been doing separate queries for each metric (i.e. 3 queries). But as they all roll up over the same period I'm hoping to reduce that to one query. The start of the query looks like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... | stats sum(Volume) as Volume, avg(MedianDuration) as AverageMedianDuration, max(MaximumDuration) as MaximumDuration by txnType
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which gives a result like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;txnType Volume  AverageMedianDuration   MaximumDuration
A       356     300                     400
B       1       902                     1200
C       292     1000                    2000
D       9439    3000                    4000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas on how to transform this into the desired format? I guess this is like an unpivot&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 00:39:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transforming-table-output/m-p/34471#M7435</guid>
      <dc:creator>andersmholmgren</dc:creator>
      <dc:date>2011-12-14T00:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: transforming table output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transforming-table-output/m-p/34472#M7436</link>
      <description>&lt;P&gt;Not sure exactly what you want but have you looked at the transpose command?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 01:34:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transforming-table-output/m-p/34472#M7436</guid>
      <dc:creator>BobM</dc:creator>
      <dc:date>2011-12-14T01:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: transforming table output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transforming-table-output/m-p/34473#M7437</link>
      <description>&lt;P&gt;yes but its not quite what I want. That just swaps the columns and rows. i.e. like&lt;/P&gt;

&lt;P&gt;txnType   A   B  C  D&lt;BR /&gt;
Volume    356 etc&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 01:39:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transforming-table-output/m-p/34473#M7437</guid>
      <dc:creator>andersmholmgren</dc:creator>
      <dc:date>2011-12-14T01:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: transforming table output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transforming-table-output/m-p/34474#M7438</link>
      <description>&lt;P&gt;I had a similar requirement and I solved it with splunk fieldsummary:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Fieldsummary"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Fieldsummary&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This means you need one query for each transaction type, as opposed to one query for each metric type. That might or might not be better, depending on your data. I was lucky and had a single transaction type and 100s of metrics.&lt;/P&gt;

&lt;P&gt;Still looking for a proper solution.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2012 23:12:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transforming-table-output/m-p/34474#M7438</guid>
      <dc:creator>MartinHarper</dc:creator>
      <dc:date>2012-12-11T23:12:59Z</dc:date>
    </item>
  </channel>
</rss>

