<?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: Where and how to exclude one of two unique values in a timechart's by clause in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126450#M34242</link>
    <description>&lt;P&gt;Try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sw sourcetype=package |bucket _time span=24h|sort - version|dedup host,_time| timechart  dc(host) as host by version
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 09 Apr 2014 20:57:52 GMT</pubDate>
    <dc:creator>linu1988</dc:creator>
    <dc:date>2014-04-09T20:57:52Z</dc:date>
    <item>
      <title>Where and how to exclude one of two unique values in a timechart's by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126449#M34241</link>
      <description>&lt;P&gt;I am trying to build a timechart in 24-hr increments which shows a count of hosts by version of a software package.   However, there are cases where during those 24-hr spans, more than one version is present, and this makes the below search return more hosts than I have.  I only want the most recent (highest) version to be returned, but I can't make the search logic work for me.&lt;/P&gt;

&lt;P&gt;The search is:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=sw sourcetype=package | timechart span=24h dc(host) by version&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If I add dedup to hosts before the timechart stanza, of course, I only get one event per host for the entire week.  I've fumbled around with latest, and last, but haven't gotten a good outcome.  &lt;/P&gt;

&lt;P&gt;Could anyone suggest an appropriate search to take days in which two host/version combinations appear and remove the events with the lowest version number?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2014 20:35:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126449#M34241</guid>
      <dc:creator>essklau</dc:creator>
      <dc:date>2014-04-09T20:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Where and how to exclude one of two unique values in a timechart's by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126450#M34242</link>
      <description>&lt;P&gt;Try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sw sourcetype=package |bucket _time span=24h|sort - version|dedup host,_time| timechart  dc(host) as host by version
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2014 20:57:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126450#M34242</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-04-09T20:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Where and how to exclude one of two unique values in a timechart's by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126451#M34243</link>
      <description>&lt;P&gt;Try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sw sourcetype=package | eventstats latest(version) as versionToUse | where version=versionToUse| timechart span=24h dc(host) by version
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sw sourcetype=package [index=sw sourcetype=package | head 1 | table version]| timechart span=24h dc(host) by version
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Apr 2014 21:06:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126451#M34243</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-04-09T21:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Where and how to exclude one of two unique values in a timechart's by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126452#M34244</link>
      <description>&lt;P&gt;you meant last(version) that would be the latest&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2014 21:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126452#M34244</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-04-09T21:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Where and how to exclude one of two unique values in a timechart's by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126453#M34245</link>
      <description>&lt;P&gt;Since Splunk gives result in chronological order of _time, I believe first should be the one appearing on top . Best option would be to use 'latest'. Will update the answer.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2014 21:17:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126453#M34245</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-04-09T21:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Where and how to exclude one of two unique values in a timechart's by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126454#M34246</link>
      <description>&lt;P&gt;This should be faster than doing &lt;CODE&gt;sort | dedup&lt;/CODE&gt;, and doesn't rely on sortable versions:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sw sourcetype=package | bucket span=24h _time as day | stats latest(version) as version by host day | rename day as _time | timechart dc(host) by version
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The fiddling with the temporary &lt;CODE&gt;day&lt;/CODE&gt; field is necessary to determine the &lt;CODE&gt;latest(version)&lt;/CODE&gt; after bucketing the &lt;CODE&gt;_time&lt;/CODE&gt; down to whole days.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2014 22:20:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126454#M34246</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-09T22:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Where and how to exclude one of two unique values in a timechart's by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126455#M34247</link>
      <description>&lt;P&gt;Martin, tried yours with great success.  Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2014 13:03:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126455#M34247</guid>
      <dc:creator>essklau</dc:creator>
      <dc:date>2014-04-10T13:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Where and how to exclude one of two unique values in a timechart's by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126456#M34248</link>
      <description>&lt;P&gt;Cool... I've promoted the comment to an answer so you can mark it as solved.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2014 13:16:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126456#M34248</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-10T13:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Where and how to exclude one of two unique values in a timechart's by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126457#M34249</link>
      <description>&lt;P&gt;VERY cool, thanks Martin!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2015 00:12:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-how-to-exclude-one-of-two-unique-values-in-a-timechart/m-p/126457#M34249</guid>
      <dc:creator>helge</dc:creator>
      <dc:date>2015-01-16T00:12:34Z</dc:date>
    </item>
  </channel>
</rss>

