<?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: Appendcols not lining up Total Volume by SLA Volume in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503022#M139968</link>
    <description>&lt;P&gt;I'd examine your output when they're not lining up - specifically, your base search piles 'em together by _time and takes all of them, but the appendcols search only takes the one where rsptime is under 2000, then counts what's left.  What if all of the rsptimes for a particular timeslot were &amp;gt; 2000?&lt;/P&gt;

&lt;P&gt;If I were you, I'd get rid of the appendcols and move that logic into the main search.  It'll be faster and it'll get around this problem entirely.&lt;/P&gt;

&lt;P&gt;Could you provide a bit of data that you are using, and also what it is (in English) that you are after?  That would probably be useful to us.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2019 15:01:36 GMT</pubDate>
    <dc:creator>Richfez</dc:creator>
    <dc:date>2019-12-10T15:01:36Z</dc:date>
    <item>
      <title>Appendcols not lining up Total Volume by SLA Volume</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503021#M139967</link>
      <description>&lt;P&gt;Trying to do a correlation search for total volume vs sla volume.  This search works if I edit the time span to an hour for the past day. Once I pull that span back to the past 7 days or last week, sla volume is not lining up as expected.&lt;BR /&gt;&lt;BR /&gt;
Any thoughts of what I am missing here in the appendcols? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=client_rest_volume earliest=-7d@w0 latest=@w0 
| bucket _time span=1d 
| stats count as tot_trans by _time 
| appendcols     
    [ search eventtype=client_rest_volume earliest=-7d@w0 latest=@w0 
        | bucket _time span=1d 
        | eval rsptime = rsptime/1000 
        | where rsptime &amp;lt; 2000 
        | stats count as sla_trans by _time] 
| eval successrate=((sla_trans/tot_trans)*100)."%"
| rename tot_trans as "Total Transactions"
| rename sla_trans as "Transactions within SLA"
| rename successrate as "SLA Success %"
| table "Total Transactions" "Transactions within SLA" "SLA Success %"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Dec 2019 14:23:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503021#M139967</guid>
      <dc:creator>fisuser1</dc:creator>
      <dc:date>2019-12-10T14:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Appendcols not lining up Total Volume by SLA Volume</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503022#M139968</link>
      <description>&lt;P&gt;I'd examine your output when they're not lining up - specifically, your base search piles 'em together by _time and takes all of them, but the appendcols search only takes the one where rsptime is under 2000, then counts what's left.  What if all of the rsptimes for a particular timeslot were &amp;gt; 2000?&lt;/P&gt;

&lt;P&gt;If I were you, I'd get rid of the appendcols and move that logic into the main search.  It'll be faster and it'll get around this problem entirely.&lt;/P&gt;

&lt;P&gt;Could you provide a bit of data that you are using, and also what it is (in English) that you are after?  That would probably be useful to us.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 15:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503022#M139968</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2019-12-10T15:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Appendcols not lining up Total Volume by SLA Volume</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503023#M139969</link>
      <description>&lt;P&gt;not sure why appending, you are using the same data ...&lt;BR /&gt;
try the following code, although there are also other ways to accomplish:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=client_rest_volume earliest=-7d@w0 latest=@w0
| bucket _time span=1d
| eventstats count as tot_trans by _time
| eval rsptime = rsptime/1000
| eval is_rsptime = if(rsptime&amp;lt;2000,"1","0")
| eventstats sum(is_rsptime) as sla_trans by _time
| rename tot_trans as "Total Transactions"
| rename sla_trans as "Transactions within SLA"
| rename successrate as "SLA Success %"
| table "Total Transactions" "Transactions within SLA" "SLA Success %"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 20:32:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503023#M139969</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-12-10T20:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Appendcols not lining up Total Volume by SLA Volume</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503024#M139970</link>
      <description>&lt;P&gt;I resolved this on my own.  Problem was not the search, but the subsearch timing out due to the massive amount of data we were pulling back in the query.  I increased the timeout slightly in the limits.conf and am able to see expected results.  Thank you for the suggestions though @adonio and @rich7177 &lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 13:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503024#M139970</guid>
      <dc:creator>fisuser1</dc:creator>
      <dc:date>2019-12-11T13:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Appendcols not lining up Total Volume by SLA Volume</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503025#M139971</link>
      <description>&lt;P&gt;@fisuser1, as this solution works, i would recommend against it. there is no reason for a sub-search and no reason to increase limits. try my search below and check the difference in performance in the job inspector.&lt;BR /&gt;
your solution is a bad practice&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 14:47:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503025#M139971</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-12-11T14:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Appendcols not lining up Total Volume by SLA Volume</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503026#M139972</link>
      <description>&lt;P&gt;Hi @fisuser1,&lt;/P&gt;

&lt;P&gt;Based off the answer from @adonio you can try this, more compact, faster and guaranteed to make you happy : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=client_rest_volume earliest=-7d@w0 latest=@w0
 | bucket _time span=1d
 | eval rsptime = rsptime/1000
 | eval is_rsptime = if(rsptime&amp;lt;2000,"1","0")
 | stats sum(is_rsptime) as sla_trans, count as tot_trans by _time
 | eval successrate=((sla_trans/tot_trans)*100)."%"
 | rename tot_trans AS "Total Transactions" sla_trans AS "Transactions within SLA" successrate AS "SLA Success %"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if that helps and don't forget to upvote if you love the answer.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 14:56:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503026#M139972</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-12-11T14:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Appendcols not lining up Total Volume by SLA Volume</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503027#M139973</link>
      <description>&lt;P&gt;@adonio you're missing :  &lt;CODE&gt;| eval successrate=((sla_trans/tot_trans)*100)."%"&lt;/CODE&gt; somewhere in your search &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 14:56:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503027#M139973</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-12-11T14:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Appendcols not lining up Total Volume by SLA Volume</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503028#M139974</link>
      <description>&lt;P&gt;13.71 seconds vs 41.065 seconds search time, you get the lollipop for the day!  thank you @DavidHourani!!!!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 20:08:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503028#M139974</guid>
      <dc:creator>fisuser1</dc:creator>
      <dc:date>2019-12-11T20:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Appendcols not lining up Total Volume by SLA Volume</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503029#M139975</link>
      <description>&lt;P&gt;Awesome @fisuser1 that's what I'm talking about !&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 20:14:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503029#M139975</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-12-11T20:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Appendcols not lining up Total Volume by SLA Volume</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503030#M139976</link>
      <description>&lt;P&gt;it's not a good practice to use append or appendcols for this search.  Instead you can use "conditional eval" to create what you need, and then have a single reporting command (timechart / stats / chart / etc)   do all the work.  this allows the reporting commands to do the work out at the indexer nodes.   This should speed up the search by a somewhat large factor and you'll also avoid any truncation limits and finalization limits around append/appendcols.&lt;/P&gt;

&lt;P&gt;try this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=client_rest_volume earliest=-7d@w0 latest=@w0 
 | eval rsptime = rsptime/1000 
 | eval is_sla_trans = if(rsptime&amp;lt;2000,1,0)
 | timechart span=1d count as tot_trans sum(is_sla_trans) as sla_trans
 | eval successrate=((sla_trans/tot_trans)*100)."%"
 | rename tot_trans as "Total Transactions"
 | rename sla_trans as "Transactions within SLA"
 | rename successrate as "SLA Success %"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;By the way I gave a talk at Conf on this sort of thing, and you can see the slides here - &lt;A href="https://conf.splunk.com/watch/conf-online.html?search=FNC2751#/"&gt;https://conf.splunk.com/watch/conf-online.html?search=FNC2751#/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;
(and possibly by the time you read this, you can also get the recording)&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 00:05:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appendcols-not-lining-up-Total-Volume-by-SLA-Volume/m-p/503030#M139976</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2019-12-13T00:05:19Z</dc:date>
    </item>
  </channel>
</rss>

