<?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 How to persist fields after group by command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-persist-fields-after-group-by-command/m-p/613293#M213142</link>
    <description>&lt;P&gt;I have a query that does a group by, which allows the sum(diff) column to be calculated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;[search] | stats sum(diff) by X_Request_ID as FinalDiff:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-09-15 at 6.28.02 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21492i09576A8AAF12E2BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-09-15 at 6.28.02 PM.png" alt="Screen Shot 2022-09-15 at 6.28.02 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;From here, how can I list out only the entries that have a sum(diff) &amp;gt; 1? My attempt looks like:&lt;/P&gt;&lt;DIV&gt;[search] | stats sum(diff) by X_Request_ID as FinalDiff |&lt;STRONG&gt;where FinalDiff&amp;gt;1&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My issue is that after the group by happens, the query seems to forget about the grouped sum and so I cannot compare it to 1.&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Thu, 15 Sep 2022 17:53:03 GMT</pubDate>
    <dc:creator>kimsej</dc:creator>
    <dc:date>2022-09-15T17:53:03Z</dc:date>
    <item>
      <title>How to persist fields after group by command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-persist-fields-after-group-by-command/m-p/613293#M213142</link>
      <description>&lt;P&gt;I have a query that does a group by, which allows the sum(diff) column to be calculated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;[search] | stats sum(diff) by X_Request_ID as FinalDiff:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-09-15 at 6.28.02 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21492i09576A8AAF12E2BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-09-15 at 6.28.02 PM.png" alt="Screen Shot 2022-09-15 at 6.28.02 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;From here, how can I list out only the entries that have a sum(diff) &amp;gt; 1? My attempt looks like:&lt;/P&gt;&lt;DIV&gt;[search] | stats sum(diff) by X_Request_ID as FinalDiff |&lt;STRONG&gt;where FinalDiff&amp;gt;1&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My issue is that after the group by happens, the query seems to forget about the grouped sum and so I cannot compare it to 1.&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Sep 2022 17:53:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-persist-fields-after-group-by-command/m-p/613293#M213142</guid>
      <dc:creator>kimsej</dc:creator>
      <dc:date>2022-09-15T17:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to persist fields after group by command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-persist-fields-after-group-by-command/m-p/613295#M213144</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Switch the order up a bit and it should work for you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| stats sum(diff) as FinalDiff by X_Request_ID&amp;nbsp; |&lt;/SPAN&gt;where FinalDiff&amp;gt;1&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 17:58:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-persist-fields-after-group-by-command/m-p/613295#M213144</guid>
      <dc:creator>thesplunkmonkey</dc:creator>
      <dc:date>2022-09-15T17:58:56Z</dc:date>
    </item>
  </channel>
</rss>

