<?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 eventstats distinct values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eventstats-distinct-values/m-p/292837#M88394</link>
    <description>&lt;P&gt;I have used below query to get distinct values:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats values(gitRepo) AS serviceName BY buildNum
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives correct values. Problem is I am not getting value for other fields. If I used eventstats all values are coming in the table output but it is getting wrong data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventstats values(gitRepo) AS serviceName BY buildNum
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I fix this?&lt;/P&gt;</description>
    <pubDate>Tue, 27 Mar 2018 00:48:19 GMT</pubDate>
    <dc:creator>kasimbekur</dc:creator>
    <dc:date>2018-03-27T00:48:19Z</dc:date>
    <item>
      <title>eventstats distinct values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eventstats-distinct-values/m-p/292837#M88394</link>
      <description>&lt;P&gt;I have used below query to get distinct values:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats values(gitRepo) AS serviceName BY buildNum
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives correct values. Problem is I am not getting value for other fields. If I used eventstats all values are coming in the table output but it is getting wrong data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventstats values(gitRepo) AS serviceName BY buildNum
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I fix this?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 00:48:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eventstats-distinct-values/m-p/292837#M88394</guid>
      <dc:creator>kasimbekur</dc:creator>
      <dc:date>2018-03-27T00:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: eventstats distinct values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eventstats-distinct-values/m-p/292838#M88395</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   ...| stats values(*) as * by buildNum
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It will give all fields unique values by buildNum&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 04:02:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eventstats-distinct-values/m-p/292838#M88395</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-03-27T04:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: eventstats distinct values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eventstats-distinct-values/m-p/292839#M88396</link>
      <description>&lt;P&gt;awesome, it worked. Can you explain more about it? so that we can understand concept better. Also let me know Splunk reference documents for above solution. &lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 16:29:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eventstats-distinct-values/m-p/292839#M88396</guid>
      <dc:creator>kasimbekur</dc:creator>
      <dc:date>2018-03-27T16:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: eventstats distinct values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eventstats-distinct-values/m-p/292840#M88397</link>
      <description>&lt;P&gt;here * denotes wildcard&lt;BR /&gt;
&lt;CODE&gt;stats values(*) as *&lt;/CODE&gt; will calculate all fields unique values&lt;BR /&gt;
have a look at &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Stats"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Stats&lt;/A&gt;&lt;BR /&gt;
&lt;CODE&gt;stats&lt;/CODE&gt; - Calculates aggregate statistics over the results set, such as average, count, and sum. This is similar to SQL aggregation. If stats is used without a by clause only one row is returned, which is the aggregation over the entire incoming result set. If you use a by clause one row is returned for each distinct value specified in the by clause.&lt;BR /&gt;
&lt;CODE&gt;eventstats&lt;/CODE&gt; - Generate summary statistics of all existing fields in your search results and saves those statistics in to new fields. The eventstats command is similar to the stats command. The difference is that with the eventstats command aggregation results are added inline to each event and added only if the aggregation is pertinent to that event.&lt;BR /&gt;
to better understand difference between stats and eventstats have a look at answer &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/139534/what-are-the-calculated-differences-between-stats-and-eventstats.html"&gt;https://answers.splunk.com/answers/139534/what-are-the-calculated-differences-between-stats-and-eventstats.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 16:47:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eventstats-distinct-values/m-p/292840#M88397</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-03-27T16:47:48Z</dc:date>
    </item>
  </channel>
</rss>

