<?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 chart after using stats latest() in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/chart-after-using-stats-latest/m-p/330507#M98383</link>
    <description>&lt;P&gt;I have the following command:&lt;/P&gt;

&lt;P&gt;sourcetype="sourcetype" eventid=731 OR eventid=730&lt;BR /&gt;
| stats latest(eventid) by target&lt;BR /&gt;
| chart count by eventid&lt;/P&gt;

&lt;P&gt;the 2nd line works as expected, but when I add in the 3rd line, i get "No results found"&lt;/P&gt;

&lt;P&gt;I want to display the results of the 2nd line in a pie chart rather than a table.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2017 15:38:15 GMT</pubDate>
    <dc:creator>jared_anderson</dc:creator>
    <dc:date>2017-10-23T15:38:15Z</dc:date>
    <item>
      <title>chart after using stats latest()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-after-using-stats-latest/m-p/330507#M98383</link>
      <description>&lt;P&gt;I have the following command:&lt;/P&gt;

&lt;P&gt;sourcetype="sourcetype" eventid=731 OR eventid=730&lt;BR /&gt;
| stats latest(eventid) by target&lt;BR /&gt;
| chart count by eventid&lt;/P&gt;

&lt;P&gt;the 2nd line works as expected, but when I add in the 3rd line, i get "No results found"&lt;/P&gt;

&lt;P&gt;I want to display the results of the 2nd line in a pie chart rather than a table.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 15:38:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-after-using-stats-latest/m-p/330507#M98383</guid>
      <dc:creator>jared_anderson</dc:creator>
      <dc:date>2017-10-23T15:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: chart after using stats latest()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-after-using-stats-latest/m-p/330508#M98384</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
add &lt;CODE&gt;AS eventid&lt;/CODE&gt; to your stats command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="sourcetype" eventid=731 OR eventid=730
| stats latest(eventid) AS eventId by target
| chart count by eventid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 15:43:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-after-using-stats-latest/m-p/330508#M98384</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-10-23T15:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: chart after using stats latest()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-after-using-stats-latest/m-p/330509#M98385</link>
      <description>&lt;P&gt;why is the AS eventid needed?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 15:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-after-using-stats-latest/m-p/330509#M98385</guid>
      <dc:creator>jared_anderson</dc:creator>
      <dc:date>2017-10-23T15:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: chart after using stats latest()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-after-using-stats-latest/m-p/330510#M98386</link>
      <description>&lt;P&gt;Because if you don't use it, the stats result field name is latest(eventId) as you can see in the column header running Your first two tows.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe &lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 16:00:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-after-using-stats-latest/m-p/330510#M98386</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-10-23T16:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: chart after using stats latest()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-after-using-stats-latest/m-p/330511#M98387</link>
      <description>&lt;P&gt;@jared_anderson, following should also give you same result. Dedup will get latest events for each target which enables you to count latest eventid for unique targets.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="sourcetype" eventid=731 OR eventid=730
| dedup target
| chart count by eventid
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Oct 2017 16:31:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-after-using-stats-latest/m-p/330511#M98387</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-10-23T16:31:23Z</dc:date>
    </item>
  </channel>
</rss>

