<?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 create a multistage Sankey diagram with a single search without needing to &amp;quot;append&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205351#M59697</link>
    <description>&lt;P&gt;Oh, that makes sense &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; That was the best way I could figure out to put in a table (HTML table markup didn't seem to work).&lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2016 19:42:25 GMT</pubDate>
    <dc:creator>doweaver</dc:creator>
    <dc:date>2016-11-03T19:42:25Z</dc:date>
    <item>
      <title>How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205348#M59694</link>
      <description>&lt;P&gt;I have a dataset where each event summarizes a workflow, using the fields Foo-&amp;gt;Bar-&amp;gt;Baz, and I'm looking to create a Sankey diagram to visualize the flow. The only way I've come up with to get the output I want is to run one search, do a stats call, and then append the same query with a different stats call, like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndex | stats count BY Foo, Bar | rename Foo AS source, Bar AS target | append [search index=myIndex | stats count BY Bar, Baz | rename Bar AS source, Baz AS target]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works, but it's incredibly inefficient, and MUCH slower than it needs to be. Is there a way to get the output I'm looking for with a single search that I'm missing?&lt;/P&gt;

&lt;P&gt;The output table would look something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source | target | count
foo1   | bar1   | 3
foo1   | bar2   | 12
bar1   | baz1   | 1
bar1   | baz2   | 2
bar2   | baz1   | 12
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Nov 2016 17:47:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205348#M59694</guid>
      <dc:creator>doweaver</dc:creator>
      <dc:date>2016-11-03T17:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205349#M59695</link>
      <description>&lt;P&gt;...I have no idea why a random "5." is showing up in the middle of the table...&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 17:50:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205349#M59695</guid>
      <dc:creator>doweaver</dc:creator>
      <dc:date>2016-11-03T17:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205350#M59696</link>
      <description>&lt;P&gt;Hi @doweaver&lt;/P&gt;

&lt;P&gt;That's just automatic numbering with anything in code blocks so people can help users point out where they've identified errors in syntax when people are sharing  multiple lines of sample data/code.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 19:02:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205350#M59696</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2016-11-03T19:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205351#M59697</link>
      <description>&lt;P&gt;Oh, that makes sense &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; That was the best way I could figure out to put in a table (HTML table markup didn't seem to work).&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 19:42:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205351#M59697</guid>
      <dc:creator>doweaver</dc:creator>
      <dc:date>2016-11-03T19:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205352#M59698</link>
      <description>&lt;P&gt;heh yeah, that's the best way to display a table format on here. you're doin it right &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 19:55:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205352#M59698</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2016-11-03T19:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205353#M59699</link>
      <description>&lt;P&gt;Cool question @doweaver. How many distinct values are there of foo bar and baz? As a solution for dc(foo) = 2 might be a lot simpler than all of those distinct values being an unknown variable.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 21:29:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205353#M59699</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2016-11-03T21:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205354#M59700</link>
      <description>&lt;P&gt;There are probably ~5 distinct values for each.&lt;/P&gt;

&lt;P&gt;I'm not sure I understand what you're getting at here:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;As a solution for dc(foo) = 2 might be a lot simpler than all of those distinct values being an unknown variable.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 03 Nov 2016 21:32:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205354#M59700</guid>
      <dc:creator>doweaver</dc:creator>
      <dc:date>2016-11-03T21:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205355#M59701</link>
      <description>&lt;P&gt;Sorry, that wasn't well worded. I just meant that if there is a smaller number of distinct values, you might be able to get a simpler answer (I'm more thinking out loud haha, sorry).&lt;/P&gt;

&lt;P&gt;So obviously foo and bar occur together, and bar and baz occur together, but do foo and baz NOT occur together, that is, is there a reason you can't search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndex | stats count by foo bar baz
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Nov 2016 22:01:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205355#M59701</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2016-11-03T22:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205356#M59702</link>
      <description>&lt;P&gt;No worries &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Unfortunately, they all three occur in a single event &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Technically, it's a transaction that links A -&amp;gt; B, with A containing Foo, and B containing Bar and Baz. I don't THINK there's a way to split things up in a way that will make that work... but I'll keep thinking about that.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 22:05:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205356#M59702</guid>
      <dc:creator>doweaver</dc:creator>
      <dc:date>2016-11-03T22:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205357#M59703</link>
      <description>&lt;P&gt;If you can count by all three fields, maybe using appendpipe would be less resource intensive than using append:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="access_combined" 
| stats count by host categoryId product_name
| appendpipe [stats count by host categoryId | rename host as source, categoryId as target]
| appendpipe [stats count by categoryId product_name | rename categoryId as source, product_name as target]
| search source=*
| fields source target count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;gives me&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://i63.tinypic.com/2wcfhcp.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 22:08:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205357#M59703</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2016-11-03T22:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205358#M59704</link>
      <description>&lt;P&gt;Yes! Perfect!&lt;/P&gt;

&lt;P&gt;Didn't realize appendpipe was a thing. Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 22:23:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205358#M59704</guid>
      <dc:creator>doweaver</dc:creator>
      <dc:date>2016-11-03T22:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205359#M59705</link>
      <description>&lt;P&gt;Hmm - I tried to post your comment as the answer, but Splunk is saying I can't make more than 2 posts per day until I hit 40 points. Pretty sure I've only made one post today, but...&lt;/P&gt;

&lt;P&gt;/shrug&lt;/P&gt;

&lt;P&gt;If you paste that same thing as the answer, I'll mark it solved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 22:28:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205359#M59705</guid>
      <dc:creator>doweaver</dc:creator>
      <dc:date>2016-11-03T22:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205360#M59706</link>
      <description>&lt;P&gt;Glad it worked. Converted &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 04:46:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205360#M59706</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2016-11-04T04:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205361#M59707</link>
      <description>&lt;P&gt;Hi  aljohnson,&lt;/P&gt;

&lt;P&gt;Thanks for your answer, it would greatly help to have it integrated in the documentation...&lt;/P&gt;

&lt;P&gt;Find below a little amendment that helps to size correctly the lines :&lt;/P&gt;

&lt;P&gt;sourcetype="access_combined" &lt;BR /&gt;
 | table host categoryId product_name&lt;BR /&gt;
 | appendpipe [stats count by host categoryId | rename host as source, categoryId as target]&lt;BR /&gt;
 | appendpipe [stats count by categoryId product_name | rename categoryId as source, product_name as target]&lt;BR /&gt;
 | search source=*&lt;BR /&gt;
 | fields source target count&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:43:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205361#M59707</guid>
      <dc:creator>fulldanad</dc:creator>
      <dc:date>2020-09-30T00:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205362#M59708</link>
      <description>&lt;P&gt;Hi aljohnson. I want to thank you very much for this solution. I applied it on my problem and it worked very well. Well done.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 09:24:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/205362#M59708</guid>
      <dc:creator>spisiakmi</dc:creator>
      <dc:date>2019-07-18T09:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a multistage Sankey diagram with a single search without needing to "append"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/597467#M208013</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/193639"&gt;@doweaver&lt;/a&gt;&amp;nbsp; .&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/76487"&gt;@aljohnson_splun&lt;/a&gt;&amp;nbsp; &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/146151"&gt;@fulldanad&lt;/a&gt;&amp;nbsp; A newbie question, I posted a thread at &lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/Modified-Sankey-visualization-for-path-analysis/m-p/597420#M48972" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/Modified-Sankey-visualization-for-path-analysis/m-p/597420#M48972&lt;/A&gt; &amp;nbsp;regarding (IMHO) the same issue as described above. I would like to replicate the final solution to check if I could apply it to my task but I can't create the dataset (external or inline) required for this search:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sourcetype="access_combined"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| table host categoryId product_name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| appendpipe [stats count by host categoryId | rename host as source, categoryId as target]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| appendpipe [stats count by categoryId product_name | rename categoryId as source, product_name as target]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| search source=*&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| fields source target count&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;could you help re-assemble it with a minimum number of lines to replicate the solution? BTW, Is it working on the sankey 1.6.0 app (the last version)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks a lot&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 18:46:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-multistage-Sankey-diagram-with-a-single-search/m-p/597467#M208013</guid>
      <dc:creator>jmurata</dc:creator>
      <dc:date>2022-05-11T18:46:32Z</dc:date>
    </item>
  </channel>
</rss>

