<?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 to convert rows to columns in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/398010#M115472</link>
    <description>&lt;P&gt;Hi sugername,&lt;/P&gt;

&lt;P&gt;can you please provide more details?&lt;BR /&gt;
What does your stats command look like?&lt;BR /&gt;
I woud suggest the easiest way was to change x and y-axis within the stats command.&lt;BR /&gt;
Kind regards,&lt;BR /&gt;
Michael&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jul 2019 14:20:14 GMT</pubDate>
    <dc:creator>jutzasconsist</dc:creator>
    <dc:date>2019-07-16T14:20:14Z</dc:date>
    <item>
      <title>How to convert rows to columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/398009#M115471</link>
      <description>&lt;P&gt;I have this result&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7368i7CB094AF75FE1AB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
I whant convert in this &lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7369iED524D10862EA178/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
transpose command does not work&lt;BR /&gt;
the stats command may work, but I don't know how&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 13:59:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/398009#M115471</guid>
      <dc:creator>sugername</dc:creator>
      <dc:date>2019-07-16T13:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert rows to columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/398010#M115472</link>
      <description>&lt;P&gt;Hi sugername,&lt;/P&gt;

&lt;P&gt;can you please provide more details?&lt;BR /&gt;
What does your stats command look like?&lt;BR /&gt;
I woud suggest the easiest way was to change x and y-axis within the stats command.&lt;BR /&gt;
Kind regards,&lt;BR /&gt;
Michael&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 14:20:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/398010#M115472</guid>
      <dc:creator>jutzasconsist</dc:creator>
      <dc:date>2019-07-16T14:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert rows to columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/398011#M115473</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| bin _time as spantime span=1d
| stats list(Remark) as Remark list(EventContents) as EventContents count list(_time) as times earliest(_time) as earliesttimes latest(_time) as latestt by AccessOwnerNAme spantime
| convert timeformat="%d.%m.%Y" ctime(spantime) as spantime
| convert timeformat="%T" ctime(times) as times, ctime(earliesttimes) as earliesttimes, ctime(latestt) as latestt
| eval latestt1=latestt, earliesttimes1=earliesttimes | convert dur2sec(latestt1), dur2sec(earliesttimes1)
| eval dayduration1=latestt1-earliesttimes1 | eval dayduration=tostring(dayduration1, "duration")
| eval earliesttimes2=earliesttimes1-32400 | eval field_in_hhmmss1=tostring(earliesttimes2, "duration")
| eval latestt2=64800-latestt1 | eval field_in_hhmmss2=tostring(latestt2, "duration")
| eval latestt3=latestt1-64800 | eval field_in_hhmmss3=tostring(latestt3, "duration")
| eval All_time="Come ".earliesttimes."
"."Has left ".latestt
| sort -Remark
| fields AccessOwnerNAme spantime All_time dayduration field_in_hhmmss1 field_in_hhmmss2 field_in_hhmmss3 Remark times
| rename spantime as Day, earliesttimes as "First event", latestt as "Last event", field_in_hhmmss1 as "Late", dayduration as "Difference between first and last event", field_in_hhmmss2 as "Early departure", field_in_hhmmss3 as "Recycling"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jul 2019 14:35:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/398011#M115473</guid>
      <dc:creator>sugername</dc:creator>
      <dc:date>2019-07-16T14:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert rows to columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/398012#M115474</link>
      <description>&lt;P&gt;I used this command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart values(All_time) over AccessOwnerNAme BY Day
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I don't know how to do count of some date&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 04:10:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/398012#M115474</guid>
      <dc:creator>sugername</dc:creator>
      <dc:date>2019-07-18T04:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert rows to columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/398013#M115475</link>
      <description>&lt;P&gt;You could try to mix stats and transpose.&lt;BR /&gt;
Here is my proposition based on your dataset : &lt;/P&gt;

&lt;P&gt;.&lt;BR /&gt;
. SPL producing screenshot-1.png&lt;BR /&gt;
.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(time) as time, values(some_time) as some_time, count(date) as date, count(some_date) as some_date by name
| eval j=mvzip(time,some_time), j=mvjoin(j,"@")
| map search="| makeresults 1 
| eval j=$j$ 
| makemv delim=\"@\" j 
| mvexpand j 
| rex field=j \"(?\S+),(?\S+)\"
| table some_time, time 
| transpose header_field=time 
| eval name=\"$name$\" , date=\"$date$\", some_date=\"$some_date$\" 
| fields - column "
| table name, tim*, date, some_date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;edit :&lt;BR /&gt;
an other option &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
 | eval _raw="  name     time     sometime      date     somedate
  name1    123    some_time1    date1    some_date1
  name1    456    some_time2    date2     
  name1    time3    some_time3    date3    some_date3
  name1    time4    some_time4    date4    some_date4
  name1    time5    some_time5    date5    some_date5
  name1    789    some_time6    date6    some_date6
  name2    123    some_time1    date1    some_date1
  name2    456    some_time2    date2    some_date2
  name2    time3    some_time3    date3    some_date3
  name2    time4    some_time4    date4    some_date4
  name2    time5    some_time5    date5    some_date5" 
 | multikv forceheader=1 | fields - _raw, _time
 | eval {time}=sometime
 | stats values(*) as *, count(date) as date2, count(somedate) as somedate2 by name
 | fields - time, somedate, sometime, date, linecount
 | rename date2 as date, somedate2 as somedate
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Jul 2019 15:12:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/398013#M115475</guid>
      <dc:creator>thomasroulet</dc:creator>
      <dc:date>2019-07-19T15:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert rows to columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/712753#M240394</link>
      <description>&lt;P&gt;Thanks! It was help me A LOT to solve my SPL problem!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 21:52:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-rows-to-columns/m-p/712753#M240394</guid>
      <dc:creator>nsaveljevas</dc:creator>
      <dc:date>2025-02-27T21:52:05Z</dc:date>
    </item>
  </channel>
</rss>

