<?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: help on transpose command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595726#M207346</link>
    <description>&lt;P&gt;&lt;A href="https://www.cjoint.com/c/LDzpRnxcFYj" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.cjoint.com/c/LDzpRnxcFYj&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2022 06:35:34 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2022-04-28T06:35:34Z</dc:date>
    <item>
      <title>Could someone help on transpose command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595717#M207340</link>
      <description>&lt;P&gt;hello&lt;/P&gt;
&lt;P&gt;I transpose events like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval time=strftime(_time,"%H:%M") 
| sort time 
| fields - _time _span _origtime _events 
| transpose 0 header_field=time column_name=KPI include_empty=true 
| rename "row1" as "7:00"
| sort KPI&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;But I have a problem with my header_field&lt;/P&gt;
&lt;P&gt;Sometimes it works well because time field is well displayed : 7:00, 8:00, 9:00.....&lt;/P&gt;
&lt;P&gt;But sometimes (between 7:00 and 9:00 most of the times and I dont no why because after it works well), instead time fields, I have row1, row2, row3....&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jip31_0-1651124956991.png" style="width: 534px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19359iA625A73098FF5B35/image-dimensions/534x104?v=v2" width="534" height="104" role="button" title="jip31_0-1651124956991.png" alt="jip31_0-1651124956991.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is anybody have an idea concerning this issue&lt;/P&gt;
&lt;P&gt;I try a workaround with the rename of row1, row2...., but the rename doesn't works&lt;/P&gt;
&lt;P&gt;Could you help please?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 18:09:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595717#M207340</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-04-28T18:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: help on transpose command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595723#M207343</link>
      <description>&lt;P&gt;If you don't have a field 'time' in your data then it will create 'row ...'.&lt;/P&gt;&lt;P&gt;What is the table before your transpose command?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 06:28:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595723#M207343</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-28T06:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: help on transpose command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595724#M207344</link>
      <description>&lt;P&gt;but I have a field time....&lt;/P&gt;&lt;P&gt;And like I said it works normaly after a little time so it's very strange...&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 06:32:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595724#M207344</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-04-28T06:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: help on transpose command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595725#M207345</link>
      <description>&lt;P&gt;Please post an image of the search results before the transpose&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 06:31:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595725#M207345</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-28T06:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: help on transpose command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595726#M207346</link>
      <description>&lt;P&gt;&lt;A href="https://www.cjoint.com/c/LDzpRnxcFYj" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.cjoint.com/c/LDzpRnxcFYj&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 06:35:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595726#M207346</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-04-28T06:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: help on transpose command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595728#M207348</link>
      <description>&lt;P&gt;That was the search, not the results.&lt;/P&gt;&lt;P&gt;What do your results look like if you run the search but without the transpose command?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 06:40:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595728#M207348</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-28T06:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: help on transpose command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595734#M207352</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jip31_0-1651129148055.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19360i179A7D94658DCA76/image-size/large?v=v2&amp;amp;px=999" role="button" title="jip31_0-1651129148055.png" alt="jip31_0-1651129148055.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 06:59:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595734#M207352</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-04-28T06:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: help on transpose command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595737#M207355</link>
      <description>&lt;P&gt;So, there is no time field, but there is a _time field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that is the data right before the transpose then that is why you get 'row X...'&lt;/P&gt;&lt;P&gt;To diagnose this, you will need to run that mammoth search and gradually remove the subsearches from the bottom to find out why of the appendcols is causing the problem.&lt;/P&gt;&lt;P&gt;Your transpose will ONLY work if the table you are converting has the correct structure.&lt;/P&gt;&lt;P&gt;The fact that you have extra rows is an indication that there is some search problem ABOVE the transpose&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 07:11:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595737#M207355</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-28T07:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: help on transpose command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595740#M207358</link>
      <description>&lt;P&gt;Ok I am going to do this but i dont understand why most of the time it works well with the same search....&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 07:18:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595740#M207358</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-04-28T07:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: help on transpose command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595747#M207362</link>
      <description>&lt;P&gt;When you work backwards, you will understand why ...&lt;/P&gt;&lt;P&gt;I think your problem is that all your timechart statements are expected to return a table like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_time	24. Portail SIBP / Espace CO - Utilisateurs ayant au moins 2 erreurs
2022-04-28 07:00	4
2022-04-28 08:00	4
2022-04-28 09:00	4
2022-04-28 10:00	4
2022-04-28 11:00	5
2022-04-28 12:00	5
2022-04-28 13:00	4
2022-04-28 14:00	4
2022-04-28 15:00	4
2022-04-28 16:00	4
2022-04-28 17:00	4
2022-04-28 18:00	0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;However, as soon as any one of those searches gets 0 events, then the appendcols is doing this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_time	24. Portail SIBP / Espace CO - Utilisateurs ayant au moins 2 erreurs
 	0&lt;/LI-CODE&gt;&lt;P&gt;so in that case, _time is null and you only have a single row, not 12 as you would get from the timechart.&lt;/P&gt;&lt;P&gt;For things to work properly, all of those searches must generate the same number of rows with _time values being the correlating row identifier.&lt;/P&gt;&lt;P&gt;In the above scenario, if your FIRST search returns 0 results then the _time column will always be null.&lt;/P&gt;&lt;P&gt;See this example search modelled on yours that exhibits the possible problem&lt;/P&gt;&lt;P&gt;You should be able to run this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_audit earliest=@d+7h latest=@d+19h user=xXXX
    | eval web_url=mvindex(split("/VP_/,/VPI/,/VPC/", ","), random() % 3)
    | fields web_url user _time
    | rename user as sam
    | eval sam=lower(sam) 
    | bin _time span=1h 
    | eval url =upper(web_url) 
    | eval SIBP=case(
        match(url,"/VP_/"),"Portail SIBP historique", match(url,"/VPI/"),"IHM porail Espace CO", match(url,"/VPC/"),"Portail Guichet Espace Co"
        ) 
    | search SIBP=* 
    | stats count as PbPerf by sam _time 
    | search PbPerf &amp;gt; 1 
    | timechart span=1h count as "NO USERS" 
    | appendpipe 
        [ stats count as _events 
        | where _events = 0 
        | eval "NO USERS" = 0 ]
| appendcols [ search index=_audit earliest=@d+7h latest=@d+19h user=*
    | eval web_url=mvindex(split("/VP_/,/VPI/,/VPC/", ","), random() % 3)
    | fields web_url user _time
    | rename user as sam
    | eval sam=lower(sam) 
    | bin _time span=1h 
    | eval url =upper(web_url) 
    | eval SIBP=case(
        match(url,"/VP_/"),"Portail SIBP historique", match(url,"/VPI/"),"IHM porail Espace CO", match(url,"/VPC/"),"Portail Guichet Espace Co"
        ) 
    | search SIBP=* 
    | stats count as PbPerf by sam _time 
    | search PbPerf &amp;gt; 1 
    | timechart span=1h count as "ALL USERS" 
    | appendpipe 
        [ stats count as _events 
        | where _events = 0 
        | eval "ALL USERS" = 0 ]
        ]&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Apr 2022 07:42:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595747#M207362</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-28T07:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: help on transpose command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595754#M207363</link>
      <description>&lt;P&gt;Sorry but its not clearing for me&lt;/P&gt;&lt;P&gt;Do i have to double all my searches with 2 différents conditions?&lt;/P&gt;&lt;PRE&gt;    | timechart span=1h count as "NO USERS" &lt;/PRE&gt;&lt;PRE&gt;    | timechart span=1h count as "ALL USERS" &lt;/PRE&gt;&lt;P&gt;Could you please give me an example from my original search?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 09:05:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/595754#M207363</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-04-28T09:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Could someone help on transpose command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/596063#M207494</link>
      <description>&lt;P&gt;Your issue is that your first search is not finding any events&lt;/P&gt;&lt;P&gt;Try setting your search time:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;earliest&amp;gt;@d+7h&amp;lt;/earliest&amp;gt;
&amp;lt;latest&amp;gt;@d+19h&amp;lt;/latest&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;and start your search like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| timechart span=1h count
| fields - count
| appendcols 
    [ search `index_mesurescontinues` sourcetype="ezoptima:signaler" type=* earliest=@d+7h latest=@d+19h 
    | fields signaler_id 
    | timechart span=1h dc(signaler_id) as "0. Signalements Utilisateur (ezOptima)" 
    | appendpipe 
        [ stats count as _events 
        | where _events = 0 
        | eval "0. Signalements Utilisateur (ezOptima)" = 0 ]
        ] 
| appendcols 
    [ search &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 May 2022 10:08:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/596063#M207494</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-01T10:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Could someone help on transpose command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/596099#M207503</link>
      <description>&lt;P&gt;Many thanks ITWhisperer, it works fine!&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 05:54:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-on-transpose-command/m-p/596099#M207503</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-05-02T05:54:17Z</dc:date>
    </item>
  </channel>
</rss>

