<?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 search and aggregate user behavior data in a httpsessionID and visualize the data by Sankey in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482335#M59312</link>
    <description>&lt;P&gt;Hi, @to4kawa ,&lt;/P&gt;

&lt;P&gt;Thank you for the proposal. I add prefix for each step actions to avoid situation that the start and end action could be the same.&lt;/P&gt;

&lt;P&gt;I met another problem now.  When I run the query with real data in splunk and append 10 steps in a sessionID. I found the nodes are discorded which make the Sankey chart hard to read, instead of the expected order: step1-&amp;gt;step2-&amp;gt;step3 etc.. Please refer to my screenshot. Is there any way to avoid this?&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jan 2020 03:09:30 GMT</pubDate>
    <dc:creator>cheriemilk</dc:creator>
    <dc:date>2020-01-14T03:09:30Z</dc:date>
    <item>
      <title>How to search and aggregate user behavior data in a httpsessionID and visualize the data by Sankey</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482333#M59310</link>
      <description>&lt;P&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/8194i4DDA84CF24765350/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;Hi team,&lt;/P&gt;

&lt;P&gt;I  have user behavior data like below in splunk, and I want to create a query which can aggregate the user behavior data in a httpsessionID , and then visualize the data by Sankey chart for understanding the user flow.&lt;/P&gt;

&lt;P&gt;timestamp, sessionID, Customer, UserID,  module, page, behavior&lt;BR /&gt;
12:00:00, SID1, CustomerA, UserA, moduleA, pageA, Open PageA&lt;BR /&gt;
12: 00:01, SID1, CustomerA, UserA, moduleA, pageA, Search&lt;BR /&gt;
12:00:02, SID1, CustomerA, UserA, moduleA, pageA, Search&lt;BR /&gt;
12:00:01, SID2, CustomerB, UserB, moduleA, pageA, Open PageA&lt;BR /&gt;
12:00:02, SID2, CustomerB, UserB, moduleA, pageA, Serach&lt;BR /&gt;
12:00:03, SID2, CustomerB, UserB, moduleA, pageA, Search&lt;BR /&gt;
12:00:01, SID3, CustomerC, UserC, moduleA, pageC, Open PageC&lt;BR /&gt;
12:00:02, SID3, CustomerC, UserC, moduleA, pageC, Generate Report&lt;BR /&gt;
12:00:03, SID3, CustomerC, UserC, moduleA, pageC, Update Report&lt;/P&gt;

&lt;P&gt;From above data, I want to create a Sankey chart like below, Please advise how to write the query. Thank you!&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/8195iB2DDF570F0E4334B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 02:39:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482333#M59310</guid>
      <dc:creator>cheriemilk</dc:creator>
      <dc:date>2020-01-13T02:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and aggregate user behavior data in a httpsessionID and visualize the data by Sankey</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482334#M59311</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="timestamp, sessionID, Customer, UserID, module, page, behavior
12:00:00, SID1, CustomerA, UserA, moduleA, pageA, Open PageA
12: 00:01, SID1, CustomerA, UserA, moduleA, pageA, Search
12:00:02, SID1, CustomerA, UserA, moduleA, pageA, Search
12:00:01, SID2, CustomerB, UserB, moduleA, pageA, Open PageA
12:00:02, SID2, CustomerB, UserB, moduleA, pageA, Search
12:00:03, SID2, CustomerB, UserB, moduleA, pageA, Search
12:00:01, SID3, CustomerC, UserC, moduleA, pageC, Open PageC
12:00:02, SID3, CustomerC, UserC, moduleA, pageC, Generate Report
12:00:03, SID3, CustomerC, UserC, moduleA, pageC, Update Report" 
| multikv forceheader=1 
| table timestamp, sessionID, Customer, UserID, module, page, behavior 
| rename COMMENT as "from here, the logic" 
| eventstats list(behavior) as list_behavior by sessionID 
| eventstats list(page) as list_page by sessionID 
| appendpipe 
    [| eventstats values(module) as start values(page) as end by UserID] 
| appendpipe 
    [| eventstats first(eval(mvindex(list_page,0))) as start first(eval(mvindex(list_behavior,0))) as end by UserID] 
| appendpipe 
    [| eventstats first(eval(mvindex(list_behavior,0))) as start first(eval(mvindex(list_behavior,1))) as end by UserID] 
| appendpipe 
    [| eventstats first(eval(mvindex(list_behavior,1))) as start first(eval(mvindex(list_behavior,2))) as end by UserID] 
| streamstats count 
| eval tmp=mvzip(count,mvzip(start,end)) 
| stats count by tmp 
| sort tmp 
| eval tmp=replace(tmp,"\d+\,","") 
| dedup tmp 
| eval start=mvindex(split(tmp,","),0), end=mvindex(split(tmp,","),1) 
| eventstats count(end) as count by end 
| eval end=if(start==end,end.".",end) 
| table start end count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @cheriemilk&lt;BR /&gt;
with &lt;CODE&gt;| eval end=if(start==end,end.".",end)&lt;/CODE&gt; , since the start and end are the same, the indications is consolidated.&lt;BR /&gt;
You have to count a little more in order to display beautifully like the example.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 04:49:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482334#M59311</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-13T04:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and aggregate user behavior data in a httpsessionID and visualize the data by Sankey</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482335#M59312</link>
      <description>&lt;P&gt;Hi, @to4kawa ,&lt;/P&gt;

&lt;P&gt;Thank you for the proposal. I add prefix for each step actions to avoid situation that the start and end action could be the same.&lt;/P&gt;

&lt;P&gt;I met another problem now.  When I run the query with real data in splunk and append 10 steps in a sessionID. I found the nodes are discorded which make the Sankey chart hard to read, instead of the expected order: step1-&amp;gt;step2-&amp;gt;step3 etc.. Please refer to my screenshot. Is there any way to avoid this?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 03:09:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482335#M59312</guid>
      <dc:creator>cheriemilk</dc:creator>
      <dc:date>2020-01-14T03:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and aggregate user behavior data in a httpsessionID and visualize the data by Sankey</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482336#M59313</link>
      <description>&lt;P&gt;@to4kawa , Please refer the to attachment "Sankey nodes disordered"  in the top of this thread.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 03:13:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482336#M59313</guid>
      <dc:creator>cheriemilk</dc:creator>
      <dc:date>2020-01-14T03:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and aggregate user behavior data in a httpsessionID and visualize the data by Sankey</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482337#M59314</link>
      <description>&lt;P&gt;I found that adding prefix for each step like below doesn't fix the data backflow issue actually&lt;BR /&gt;
. for example below query doesn't create the correct sankey. (I removed the last event for userC)&lt;/P&gt;

&lt;P&gt;| makeresults &lt;BR /&gt;
| eval _raw="timestamp, sessionID, Customer, UserID, module, page, behavior&lt;BR /&gt;
 12:00:00, SID1, CustomerA, UserA, moduleA, pageA, Open PageA&lt;BR /&gt;
 12:00:01, SID1, CustomerA, UserA, moduleA, pageA, Search&lt;BR /&gt;
 12:00:02, SID1, CustomerA, UserA, moduleA, pageA, Search&lt;BR /&gt;
 12:00:01, SID2, CustomerB, UserB, moduleA, pageA, Open PageA&lt;BR /&gt;
 12:00:02, SID2, CustomerB, UserB, moduleA, pageA, Search&lt;BR /&gt;
 12:00:03, SID2, CustomerB, UserB, moduleA, pageA, Search&lt;BR /&gt;
 12:00:01, SID3, CustomerC, UserC, moduleA, pageC, Open PageC&lt;BR /&gt;
 12:00:02, SID3, CustomerC, UserC, moduleA, pageC, Generate Report"&lt;BR /&gt;
 | multikv forceheader=1 &lt;BR /&gt;
 | table timestamp, sessionID, Customer, UserID, module, page, behavior &lt;BR /&gt;
 | eventstats list(behavior) as list_behavior by sessionID &lt;BR /&gt;
 | appendpipe &lt;BR /&gt;
     [| eventstats first(eval("step1".mvindex(list_behavior,0))) as start first(eval("step2".mvindex(list_behavior,1))) as end by UserID] &lt;BR /&gt;
 | appendpipe &lt;BR /&gt;
     [| eventstats first(eval("step2".mvindex(list_behavior,1))) as start first(eval("step3".mvindex(list_behavior,2))) as end by UserID] &lt;BR /&gt;
 | appendpipe &lt;BR /&gt;
     [| eventstats first(eval("step3".mvindex(list_behavior,2))) as start first(eval(if(isnull(mvindex(list_behavior,3), "step4".mvindex(list_behavior,3), "exit"))))) as end by UserID] &lt;BR /&gt;
| streamstats count &lt;BR /&gt;
 | eval tmp=mvzip(count,mvzip(start,end)) &lt;BR /&gt;
 | stats count by tmp &lt;BR /&gt;
 | sort tmp &lt;BR /&gt;
 | eval tmp=replace(tmp,"\d+\,","") &lt;BR /&gt;
 | dedup tmp &lt;BR /&gt;
 | eval start=mvindex(split(tmp,","),0), end=mvindex(split(tmp,","),1) &lt;BR /&gt;
 | eventstats count(end) as count by end &lt;BR /&gt;
 | eval end=if(start==end,end.".",end) &lt;BR /&gt;
 | table tmp start end count&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:39:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482337#M59314</guid>
      <dc:creator>cheriemilk</dc:creator>
      <dc:date>2020-09-30T03:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and aggregate user behavior data in a httpsessionID and visualize the data by Sankey</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482338#M59315</link>
      <description>&lt;P&gt;hi @cheriemilk&lt;BR /&gt;
Screen confirmed.&lt;BR /&gt;
The order has been adjusted in various ways this time.&lt;BR /&gt;
I won't know without actual queries and results.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 14:21:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-search-and-aggregate-user-behavior-data-in-a/m-p/482338#M59315</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-14T14:21:53Z</dc:date>
    </item>
  </channel>
</rss>

