<?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: Addtotals in table issue in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270382#M81366</link>
    <description>&lt;P&gt;Thanks Dave, anyway I've already got a solution provided by Michael.&lt;/P&gt;</description>
    <pubDate>Fri, 27 May 2016 09:10:33 GMT</pubDate>
    <dc:creator>splunkreal</dc:creator>
    <dc:date>2016-05-27T09:10:33Z</dc:date>
    <item>
      <title>Addtotals in table issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270376#M81360</link>
      <description>&lt;P&gt;Hello, I'd like to add totals to remove the two-lines result per row, how to do? Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 10:07:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270376#M81360</guid>
      <dc:creator>splunkreal</dc:creator>
      <dc:date>2016-05-26T10:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Addtotals in table issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270377#M81361</link>
      <description>&lt;P&gt;See if this works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch 
[search index=d2i sourcetype=D2I_Fichesconsolidees typ_stat=*_TOTAL | rename counter as total_count]
[search index=d2i sourcetype=D2I_Fichesconsolidees typ_stat=*_PERMIS | rename counter as perm_count]
| stats sum(total_count) as total_count sum(perm_count) as perm_count by type_fiche
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note, you need to use the different "e" in Ficheconsolidees as I dont have this "e" on my keyboard.&lt;/P&gt;

&lt;P&gt;Even better though:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=d2i sourcetype=D2I_Fichesconsolidees (typ_stat=*_TOTAL OR typ_stat=*PERMIS) 
| eval total_count=if(typ_stat=*_TOTAL,counter,null()) 
| eval perm_count=if(typ_stat=*_PERMIS,counter,null()) 
| stats sum(total_count) as total_count sum(perm_count) as perm_count by type_fiche
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 May 2016 12:01:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270377#M81361</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-05-26T12:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Addtotals in table issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270378#M81362</link>
      <description>&lt;P&gt;&lt;STRONG&gt;| multisearch &lt;BR /&gt;
 [search index=d2i sourcetype=D2I_Fichesconsolidées typ_stat=&lt;EM&gt;_TOTAL | rename counter as total_count]&lt;BR /&gt;
 [search index=d2i sourcetype=D2I_Fichesconsolidées typ_stat=&lt;/EM&gt;_PERMIS | rename counter as perm_count]&lt;BR /&gt;
 | stats sum(total_count) as total_count sum(perm_count) as perm_count by typ_fiche&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Dear Michael, first search worked (just a mistake at 'typ_fiche'), thanks a lot!&lt;/P&gt;

&lt;P&gt;Second search was giving an error at eval :&lt;/P&gt;

&lt;P&gt;Error in 'eval' command: The expression is malformed. An unexpected character is reached at '*_TOTAL,counter,null())'.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270378#M81362</guid>
      <dc:creator>splunkreal</dc:creator>
      <dc:date>2020-09-29T09:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Addtotals in table issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270379#M81363</link>
      <description>&lt;P&gt;OK great, but you want to run just one search for this as it is more efficient, uses less cpu, memory, etc.  Try this too please:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=d2i sourcetype=D2I_Fichesconsolidees (typ_stat=*_TOTAL OR typ_stat=*PERMIS) 
 | eval total_count=if(match(typ_stat,"*_TOTAL"),counter,null()) 
 | eval perm_count=if(match(typ_stat,"*_PERMIS"),counter,null()) 
 | stats sum(total_count) as total_count sum(perm_count) as perm_count by typ_fiche
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 May 2016 14:52:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270379#M81363</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-05-26T14:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Addtotals in table issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270380#M81364</link>
      <description>&lt;P&gt;"Error in 'eval' command: Regex: nothing to repeat"&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 07:25:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270380#M81364</guid>
      <dc:creator>splunkreal</dc:creator>
      <dc:date>2016-05-27T07:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Addtotals in table issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270381#M81365</link>
      <description>&lt;P&gt;Take a look at the like and match functions in the &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions#Comparison_and_Conditional_functions"&gt;Search Reference documentation&lt;/A&gt;, you should probably be able to use either to accomplish the solution proposed by jkat54. &lt;/P&gt;

&lt;P&gt;I could attempt a solution, but you won't be learning anything that way. If you are still having problems having read the documentation, post the searches you've tried and how they're failing to produce the desired results. If you are successful it would be nice to see the query you decided to use. &lt;/P&gt;

&lt;P&gt;Dave &lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 09:00:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270381#M81365</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2016-05-27T09:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Addtotals in table issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270382#M81366</link>
      <description>&lt;P&gt;Thanks Dave, anyway I've already got a solution provided by Michael.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 09:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270382#M81366</guid>
      <dc:creator>splunkreal</dc:creator>
      <dc:date>2016-05-27T09:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Addtotals in table issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270383#M81367</link>
      <description>&lt;P&gt;My comment was referring to the "Error in 'eval' command: Regex: nothing to repeat" message. If you have a solution that matches your needs then Happy Splunking.&lt;/P&gt;

&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 10:45:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Addtotals-in-table-issue/m-p/270383#M81367</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2016-05-27T10:45:58Z</dc:date>
    </item>
  </channel>
</rss>

