<?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 edit my search with appendpipe and subsearch to append subtotals under each individual user, not at the end? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-with-appendpipe-and-subsearch-to-append/m-p/239937#M71316</link>
    <description>&lt;P&gt;Thank you! I missed one of the changes you made. This is what I missed the first time I tried your suggestion: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval user=user."'s Total count"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I left the string "Total" in front of user:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval user="Total".user."'s count"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After I removed "Total" as it's in your search, the total lines printed correctly. Would you please explain why "Total" concatenated with user caused the issue? Thanks again for the help.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Nov 2015 20:08:20 GMT</pubDate>
    <dc:creator>GirolamoBo</dc:creator>
    <dc:date>2015-11-23T20:08:20Z</dc:date>
    <item>
      <title>How do I edit my search with appendpipe and subsearch to append subtotals under each individual user, not at the end?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-with-appendpipe-and-subsearch-to-append/m-p/239933#M71312</link>
      <description>&lt;P&gt;Here is my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="xyz" [search sourcetype="abc" "Threshold exceeded"| top user limit=3 | fields user] 
| stats count by user integration 
| appendpipe [stats sum(count) by user integration | eval user="Total".user."'s count" ] 
| sort count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It returns correct stats, but the subtotals per user are not appended to individual user's, but appended to the end.&lt;/P&gt;

&lt;P&gt;I currently get this:&lt;/P&gt;

&lt;P&gt;userA   integration1 count&lt;BR /&gt;
userA   integration2 count&lt;BR /&gt;
userB  integration3 count&lt;BR /&gt;
userB  integration4 count&lt;BR /&gt;
Total userA's sum(count)&lt;BR /&gt;
Total userB's sum(count)&lt;/P&gt;

&lt;P&gt;I would like the totals per user to be grouped like this:&lt;/P&gt;

&lt;P&gt;userA  integration1 count&lt;BR /&gt;
userA   integration2 count&lt;BR /&gt;
Total userA's sum(count)&lt;BR /&gt;
userB  integration3 count&lt;BR /&gt;
userB  integration4 count&lt;BR /&gt;
Total userB's sum(count)&lt;/P&gt;

&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 00:12:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-with-appendpipe-and-subsearch-to-append/m-p/239933#M71312</guid>
      <dc:creator>GirolamoBo</dc:creator>
      <dc:date>2015-11-19T00:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search with appendpipe and subsearch to append subtotals under each individual user, not at the end?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-with-appendpipe-and-subsearch-to-append/m-p/239934#M71313</link>
      <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;P&gt;sourcetype="xyz" [search sourcetype="abc" "Threshold exceeded"| top user limit=3 | fields user] &lt;BR /&gt;
| stats count by user integration &lt;BR /&gt;
&lt;STRONG&gt;| appendpipe [stats sum(count) by user | eval user=user."'s Total count" ] &lt;BR /&gt;
| sort user count&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 01:54:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-with-appendpipe-and-subsearch-to-append/m-p/239934#M71313</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2015-11-19T01:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search with appendpipe and subsearch to append subtotals under each individual user, not at the end?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-with-appendpipe-and-subsearch-to-append/m-p/239935#M71314</link>
      <description>&lt;P&gt;thank you HiroshiStosh. From what I can see you added user to the sort. I am afraid it did not work: the totals are still listed together, but they are now on top:&lt;BR /&gt;
Total userA's sum(count)&lt;BR /&gt;
Total userB's sum(count)&lt;BR /&gt;
userA integration1 count&lt;BR /&gt;
userA integration2 count&lt;BR /&gt;
userB integration3 count&lt;BR /&gt;
userB integration4 count&lt;BR /&gt;
I would like each row for totals for respective user to appear after the rows for each user:&lt;BR /&gt;
userA integration1 count&lt;BR /&gt;
userA integration2 count&lt;BR /&gt;
Total userA's sum(count)&lt;BR /&gt;
userB integration3 count&lt;BR /&gt;
userB integration4 count&lt;BR /&gt;
Total userB's sum(count)&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 17:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-with-appendpipe-and-subsearch-to-append/m-p/239935#M71314</guid>
      <dc:creator>GirolamoBo</dc:creator>
      <dc:date>2015-11-19T17:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search with appendpipe and subsearch to append subtotals under each individual user, not at the end?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-with-appendpipe-and-subsearch-to-append/m-p/239936#M71315</link>
      <description>&lt;P&gt;It is an execution result of my search statement.&lt;BR /&gt;
user,integration,count,sum(count)&lt;BR /&gt;
userA,integration1,10,&lt;BR /&gt;
userA,integration2,99,&lt;BR /&gt;
&lt;STRONG&gt;userA's Total count&lt;/STRONG&gt;,,,109&lt;BR /&gt;&lt;BR /&gt;
userB,integration4,11,&lt;BR /&gt;
userB,integration3,80,&lt;BR /&gt;
&lt;STRONG&gt;userB's Total count&lt;/STRONG&gt;,,,90  &lt;/P&gt;

&lt;P&gt;And is the result of running your search statement.&lt;/P&gt;

&lt;P&gt;user,integration,count,sum(count)&lt;BR /&gt;
Total userA's count,,,109  ※count is null&lt;BR /&gt;
Total userB's count,,,90  ※count is null&lt;BR /&gt;
userA,integration1,10,&lt;BR /&gt;
userB,integration4,11,&lt;BR /&gt;
userB,integration3,80,&lt;BR /&gt;
userA,integration2,99,&lt;/P&gt;

&lt;P&gt;It is sufficient to add a field for sorting If you want to field name "Total user･･･".&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 14:47:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-with-appendpipe-and-subsearch-to-append/m-p/239936#M71315</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2015-11-21T14:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search with appendpipe and subsearch to append subtotals under each individual user, not at the end?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-with-appendpipe-and-subsearch-to-append/m-p/239937#M71316</link>
      <description>&lt;P&gt;Thank you! I missed one of the changes you made. This is what I missed the first time I tried your suggestion: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval user=user."'s Total count"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I left the string "Total" in front of user:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval user="Total".user."'s count"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After I removed "Total" as it's in your search, the total lines printed correctly. Would you please explain why "Total" concatenated with user caused the issue? Thanks again for the help.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 20:08:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-with-appendpipe-and-subsearch-to-append/m-p/239937#M71316</guid>
      <dc:creator>GirolamoBo</dc:creator>
      <dc:date>2015-11-23T20:08:20Z</dc:date>
    </item>
  </channel>
</rss>

