<?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: add fields after a stats count in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376503#M171222</link>
    <description>&lt;P&gt;the 'table list 'command does not seem to work when I use it as you describe&lt;/P&gt;</description>
    <pubDate>Thu, 16 May 2019 19:01:36 GMT</pubDate>
    <dc:creator>Mike6960</dc:creator>
    <dc:date>2019-05-16T19:01:36Z</dc:date>
    <item>
      <title>add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376491#M171210</link>
      <description>&lt;P&gt;In my search i use a couple of stats counts, the problem is that after these commands I miss other that I want to use. For example _time. I dont need a count for these fields so how can I make sure they are stille available later on in the search?&lt;/P&gt;

&lt;P&gt;My search is for example:&lt;/P&gt;

&lt;P&gt;index=* &lt;BR /&gt;
"message.Origin"=blabla&lt;BR /&gt;
source="something " &lt;BR /&gt;
| stats count(eval('logger' ="test1")) as "example",&lt;BR /&gt;
count(eval(logger ="test2)) as "example2" by ID&lt;/P&gt;

&lt;P&gt;After the stats I only have the fields, example, example2 and ID&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 11:13:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376491#M171210</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2019-05-16T11:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376492#M171211</link>
      <description>&lt;P&gt;use &lt;CODE&gt;eventstats&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 12:43:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376492#M171211</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-05-16T12:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376493#M171212</link>
      <description>&lt;P&gt;@adonio means replace &lt;CODE&gt;stats&lt;/CODE&gt; with &lt;CODE&gt;eventstats&lt;/CODE&gt; and fields won't be dropped.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 13:11:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376493#M171212</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-05-16T13:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376494#M171213</link>
      <description>&lt;P&gt;Replace stats with eventstats. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=*  "message.Origin"=blabla source="something " 
| eventstats count(eval('logger' ="test1")) as "example1", count(eval(logger ="test2)) as "example2" by ID
| table example1,example2,source,index,ID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: Eventstats is not good if you are concerned about the performance. &lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 14:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376494#M171213</guid>
      <dc:creator>preactivity</dc:creator>
      <dc:date>2019-05-16T14:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376495#M171214</link>
      <description>&lt;P&gt;yes. eventstats keeps all fields available for next command.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 17:46:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376495#M171214</guid>
      <dc:creator>iparitosh</dc:creator>
      <dc:date>2019-05-16T17:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376496#M171215</link>
      <description>&lt;P&gt;but if I use eventstats i get all the events back. So also the ones that don't match the conditions in the evals. I only want the event that (for example) where  logger= "test1"&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 18:07:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376496#M171215</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2019-05-16T18:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376497#M171216</link>
      <description>&lt;P&gt;but if I use eventstats i get all the events back. So also the ones that don't match the conditions in the evals. I only want the event that (for example) where logger= "test1"&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 18:08:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376497#M171216</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2019-05-16T18:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376498#M171217</link>
      <description>&lt;P&gt;Post event stats you can filter events with | search logger=“test1”&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 18:13:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376498#M171217</guid>
      <dc:creator>iparitosh</dc:creator>
      <dc:date>2019-05-16T18:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376499#M171218</link>
      <description>&lt;P&gt;ok, I wonder why I should stats or eventstats at all...... I could just use the search= instead, every tme when I think I understand Splunk I get confused&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 18:20:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376499#M171218</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2019-05-16T18:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376500#M171219</link>
      <description>&lt;P&gt;Try to apply all searches at the first stage so that you will have less data for the computation.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=*  "message.Origin"=blabla source="something " 
| search logger="test1" OR logger="test2"
 | eventstats count(eval('logger' ="test1")) as "example1", count(eval(logger ="test2)) as "example2" by ID
 | table example1,example2,source,index,ID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 May 2019 18:23:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376500#M171219</guid>
      <dc:creator>preactivity</dc:creator>
      <dc:date>2019-05-16T18:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376501#M171220</link>
      <description>&lt;P&gt;Thanks, but with the stats command I got one line per ID and the 'loggers' in columns next to it. With eventstats I get per logger one line. what I need is for every single ID just one line with the other fields in columns next to it&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 18:30:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376501#M171220</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2019-05-16T18:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376502#M171221</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* "message.Origin"=blabla source="something " 
| eventstats count(eval('logger' ="test1")) as "example",
count(eval(logger ="test2”)) as "example2" by ID
| stats List(field1) as field1 List(field2) as field2... List(fieldN) as fieldN max(example) max(example2) by ID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 May 2019 18:40:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376502#M171221</guid>
      <dc:creator>iparitosh</dc:creator>
      <dc:date>2019-05-16T18:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376503#M171222</link>
      <description>&lt;P&gt;the 'table list 'command does not seem to work when I use it as you describe&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 19:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376503#M171222</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2019-05-16T19:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376504#M171223</link>
      <description>&lt;P&gt;My bad it should be &lt;BR /&gt;
... | stats list(field_name)... by ID&lt;/P&gt;

&lt;P&gt;Edited my answer.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 19:05:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376504#M171223</guid>
      <dc:creator>iparitosh</dc:creator>
      <dc:date>2019-05-16T19:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376505#M171224</link>
      <description>&lt;P&gt;I tried stats list instead but it does not seem to get the results I want&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 19:06:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376505#M171224</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2019-05-16T19:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376506#M171225</link>
      <description>&lt;P&gt;Can you explain what is the issue and provide your query here?&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 19:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376506#M171225</guid>
      <dc:creator>iparitosh</dc:creator>
      <dc:date>2019-05-16T19:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: add fields after a stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376507#M171226</link>
      <description>&lt;P&gt;Just add dedup after the eventstats.&lt;BR /&gt;
     index=*  "message.Origin"=blabla source="something " &lt;BR /&gt;
     | search logger="test1" OR logger="test2"&lt;BR /&gt;
      | eventstats count(eval('logger' ="test1")) as "example1", count(eval(logger ="test2)) as "example2" by ID&lt;BR /&gt;
    | dedup ID&lt;BR /&gt;
      | table example1,example2,source,index,ID&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 19:13:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-fields-after-a-stats-count/m-p/376507#M171226</guid>
      <dc:creator>preactivity</dc:creator>
      <dc:date>2019-05-16T19:13:40Z</dc:date>
    </item>
  </channel>
</rss>

