<?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: AddcolsTotals &amp; Where Statement in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343430#M101700</link>
    <description>&lt;P&gt;instead of addcoltotals try appendpipe&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | appendpipe [stats sum(eval(if((totaldays&amp;lt;28), totaldays,0))) AS "Total Count 28 Days or Less"]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 09 Mar 2018 16:20:58 GMT</pubDate>
    <dc:creator>kmaron</dc:creator>
    <dc:date>2018-03-09T16:20:58Z</dc:date>
    <item>
      <title>AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343419#M101689</link>
      <description>&lt;P&gt;Hi, I wonder whether someone may be able to help me please.&lt;/P&gt;

&lt;P&gt;I'm using the query below which calcluates the difference between two for a group of users:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`tcs_wmf(misFullReceived)` OR (`submissions_wmf(Submission)` detail.changeType=EndAJob)
| fields detail.rawData detail.id detail.endDate
| transaction detail.id endswith="EndAJob" maxspan=2h 
| spath input=detail.rawData output=jobs path=applicant1.PaidJobs
| rename detail.endDate as empend detail.id as ID
| stats count by jobs ID _time empend
| where jobs=1 
| eval eventtime=_time, endofjob= strptime('empend', "%Y-%m-%d"), processedtime=_time, duration=(processedtime-endofjob)/86400, totaldays=round(duration,0)
| convert ctime(_time) as timestamp timeformat="%d/%m/%y"
| fields - _time
| fields empend timestamp totaldays nino
| addcoltotals totaldays labelfield=timestamp label="Total Count 28 Days or Less"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The difficulty I'm having is in the final line of code.&lt;/P&gt;

&lt;P&gt;I'd like to use the 'Column Total' to only count the rows where the "Total Days" row value is 28 or less but I'm at a bit of a loss about how to do this.&lt;/P&gt;

&lt;P&gt;I just wondered whether someone may be able to offer some guidance on how I may go about this.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 08:17:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343419#M101689</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2018-03-09T08:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343420#M101690</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Before the last line (| addcoltotals), why don't you filter only the rows that fall within the totaldays&amp;lt;28.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | fields - _time
 | fields empend timestamp totaldays nino
| where totaldays&amp;lt;29
| addcoltotals totaldays labelfield=timestamp label="Total Count 28 Days or Less"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Maybe I'm not fully understanding your issue here. Let me know please&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 08:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343420#M101690</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-09T08:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343421#M101691</link>
      <description>&lt;P&gt;Do you want to remove row were &amp;gt; 28?&lt;BR /&gt;
If yes&lt;BR /&gt;
| search totaldays &amp;lt; 29&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 08:25:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343421#M101691</guid>
      <dc:creator>valiquet</dc:creator>
      <dc:date>2018-03-09T08:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343422#M101692</link>
      <description>&lt;P&gt;Hi @tiagofbmm, I'm sorry perhaps my explanation was insufficient.&lt;/P&gt;

&lt;P&gt;I still want to show all the results but for the count to only count those out of the list which have a value of 28 or less.&lt;/P&gt;

&lt;P&gt;I hope this helps.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris &lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 08:32:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343422#M101692</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2018-03-09T08:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343423#M101693</link>
      <description>&lt;P&gt;Hi @valiquet, I'm sorry for perhaps not explainig sufficiently.&lt;/P&gt;

&lt;P&gt;But I'd like to shwo all the values in the table of results, but only count those where the value is 28 or less.&lt;/P&gt;

&lt;P&gt;I hope this helps.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 08:34:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343423#M101693</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2018-03-09T08:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343424#M101694</link>
      <description>&lt;P&gt;Ok so did you try what I suggested?&lt;/P&gt;

&lt;P&gt;I think it does count you only the rows that have value 28 or less&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 08:36:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343424#M101694</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-09T08:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343425#M101695</link>
      <description>&lt;P&gt;You can try something like this&lt;/P&gt;

&lt;P&gt;Try this run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval int="1 2 3 4 5 6 7 8 9 10 30 33 232 646 85" 
| makemv int 
| mvexpand int 
| eventstats sum(eval(if((int&amp;lt;28), int,0))) AS "Total Count 28 Days or Less"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try this in your current search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`tcs_wmf(misFullReceived)` OR (`submissions_wmf(Submission)` detail.changeType=EndAJob) 
| fields detail.rawData detail.id detail.endDate 
| transaction detail.id endswith="EndAJob" maxspan=2h 
| spath input=detail.rawData output=jobs path=applicant1.PaidJobs 
| rename detail.endDate as empend detail.id as ID 
| stats count by jobs ID _time empend 
| where jobs=1 
| eval eventtime=_time, endofjob= strptime('empend', "%Y-%m-%d"), processedtime=_time, duration=(processedtime-endofjob)/86400, totaldays=round(duration,0) 
| convert ctime(_time) as timestamp timeformat="%d/%m/%y" 
| fields - _time 
| fields empend timestamp totaldays nino 
| eventstats sum(eval(if((totaldays&amp;lt;28), totaldays,0))) AS "Total Count 28 Days or Less"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 09:24:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343425#M101695</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-03-09T09:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343426#M101696</link>
      <description>&lt;P&gt;Hi @mayurr98, thank you for coming back to me with this.&lt;/P&gt;

&lt;P&gt;Unfortunately it doesn't work  as I'd hoped.&lt;/P&gt;

&lt;P&gt;There is a an extra column for the eventstats with the total in wach row, rather than one total at the end of the column.&lt;/P&gt;

&lt;P&gt;In addition, it was also summing the totaldays values, rather than counting. So I did try to changing sum to count, but this doesn't work either.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 09:46:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343426#M101696</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2018-03-09T09:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343427#M101697</link>
      <description>&lt;P&gt;yeah unfortunately eventstats works in that way, it will show you results at each row and not only at the end of the table&lt;BR /&gt;
if you want just count then you should try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventstats count(eval(case((int&amp;lt;28),int))) AS "Total Count 28 Days or Less"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Mar 2018 10:12:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343427#M101697</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-03-09T10:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343428#M101698</link>
      <description>&lt;P&gt;Hi, thank you for coming back to me with this.&lt;/P&gt;

&lt;P&gt;Unfortunately though it's not counting any totals now.&lt;/P&gt;

&lt;P&gt;Many thanks and regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 10:46:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343428#M101698</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2018-03-09T10:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343429#M101699</link>
      <description>&lt;P&gt;If you want to add a row at the bottom of your results that counts the number of events with &lt;CODE&gt;totaldays&amp;lt;=28&lt;/CODE&gt; and put a label of "Total Count 28 Days or Less" into the &lt;CODE&gt;timestamp&lt;/CODE&gt; field, this should do it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search
| appendpipe 
 [| stats count(eval(totaldays&amp;lt;=28)) AS totaldays 
  | eval timestamp="Total Count 28 Days or Less" ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Mar 2018 14:20:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343429#M101699</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-03-09T14:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343430#M101700</link>
      <description>&lt;P&gt;instead of addcoltotals try appendpipe&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | appendpipe [stats sum(eval(if((totaldays&amp;lt;28), totaldays,0))) AS "Total Count 28 Days or Less"]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Mar 2018 16:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343430#M101700</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-03-09T16:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343431#M101701</link>
      <description>&lt;P&gt;Hi @kmaron. Thank you for taking the time to come back to me with this.&lt;/P&gt;

&lt;P&gt;I've had a look at this, but unfortunately I think I'm right in saying that the 'appendpipe' results are restricted to 50,000 rows?&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 07:49:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343431#M101701</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2018-03-12T07:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343432#M101702</link>
      <description>&lt;P&gt;Hi @elliotproebstel, thank you for taking the time to come back to me with this. But am I right in thinking the results are restricted to 50,000 rows?&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 07:51:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343432#M101702</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2018-03-12T07:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: AddcolsTotals &amp; Where Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343433#M101703</link>
      <description>&lt;P&gt;Hmm, I would expect that might be a default number of rows to be returned and wouldn't have thought it would limit the number of rows &lt;EM&gt;analyzed&lt;/EM&gt; to produce the result, but you could certainly be right. &lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 00:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/AddcolsTotals-Where-Statement/m-p/343433#M101703</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-03-13T00:56:07Z</dc:date>
    </item>
  </channel>
</rss>

