<?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 do I convert rows to columns by time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413102#M119121</link>
    <description>&lt;P&gt;Try &lt;BR /&gt;
Timechart last(Value)  by host span = 15 min&lt;/P&gt;</description>
    <pubDate>Wed, 10 Oct 2018 12:30:46 GMT</pubDate>
    <dc:creator>Vijeta</dc:creator>
    <dc:date>2018-10-10T12:30:46Z</dc:date>
    <item>
      <title>How do I convert rows to columns by time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413101#M119120</link>
      <description>&lt;P&gt;I have universal forwarder data which I access using the below query, but the fields are coming in each row.&lt;/P&gt;

&lt;P&gt;I want all these rows to be columns by time.&lt;/P&gt;

&lt;P&gt;When i do chart, I lose the time and it shows only the last value by time instead of showing for each time.&lt;/P&gt;

&lt;P&gt;How do I fix the query so that i have the last value for each time?&lt;/P&gt;

&lt;P&gt;the data gets collected every 15 mins..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=win_uf sourcetype="Perfmon:LogicalDisk" host="####" instance="_Total"
|eval RaisedDateTime=_time
|search counter="% Free Space" OR counter="Free Megabytes" OR counter="% Idle Time" OR counter="Avg. Disk sec/Transfer"
|table host counter _time Value
|bucket _time span=15m 
|chart last(Value) by host counter
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this works, but shows a single line for all the time frames.&lt;/P&gt;

&lt;P&gt;But, i would like to see the same line for each time entry..&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 06:39:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413101#M119120</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2018-10-10T06:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert rows to columns by time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413102#M119121</link>
      <description>&lt;P&gt;Try &lt;BR /&gt;
Timechart last(Value)  by host span = 15 min&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 12:30:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413102#M119121</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2018-10-10T12:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert rows to columns by time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413103#M119122</link>
      <description>&lt;P&gt;Thanks for your response , im missing the counter field which has the actual rows that should be columns.&lt;BR /&gt;
such as FreeMB etc...&lt;/P&gt;

&lt;P&gt;how to include the counter field as well..&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 15:03:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413103#M119122</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2018-10-10T15:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert rows to columns by time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413104#M119123</link>
      <description>&lt;P&gt;Either use&lt;/P&gt;

&lt;P&gt;|stats last(Value) by _time host counter&lt;/P&gt;

&lt;P&gt;Once the chart is plotted , you can use trellis layout from chart settings and display as per host or counter&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 15:27:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413104#M119123</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2018-10-10T15:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert rows to columns by time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413105#M119124</link>
      <description>&lt;P&gt;unfortunately , i need to show it by counter as its getting fed into a summary index , after which the visualization is configured..&lt;/P&gt;

&lt;P&gt;the above one gives me the data,  but the counter fields are still rows..&lt;/P&gt;

&lt;P&gt;i need counter rows as columns and _time as column and host as column&lt;BR /&gt;
the counter rows which are now columns should have the appropriate values for each column.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 15:43:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413105#M119124</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2018-10-10T15:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert rows to columns by time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413106#M119125</link>
      <description>&lt;P&gt;i dont know if this is the right way to do it, but i got it working by using evals..&lt;/P&gt;

&lt;P&gt;index=testindex sourcetype="Perfmon:LogicalDisk" instance="_Total"&lt;BR /&gt;
|search counter="% Free Space" OR counter="Free Megabytes" OR counter="% Idle Time" OR counter="Avg. Disk sec/Transfer"&lt;BR /&gt;
|table host Value counter _time&lt;BR /&gt;
|eval TimeHost=_time+":"+host&lt;BR /&gt;
|chart values(Value) by TimeHost counter &lt;BR /&gt;
|eval ActualTime=mvindex(split(TimeHost,":"),0) &lt;BR /&gt;
|eval fields=split(TimeHost,":") &lt;BR /&gt;
|eval host=mvindex(fields,1) &lt;BR /&gt;
|fields - fields TimeHost&lt;BR /&gt;
|eval _time=ActualTime&lt;/P&gt;

&lt;P&gt;i now have all the fields of counter with appropriate values + host + _time..&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:35:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-convert-rows-to-columns-by-time/m-p/413106#M119125</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-09-29T21:35:50Z</dc:date>
    </item>
  </channel>
</rss>

