<?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: Exclude result like the first result in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274112#M82677</link>
    <description>&lt;P&gt;Hi Dinesh, can you please update us what is this "_time" clearly.. is it the device available "from time" ? &lt;BR /&gt;
Laptop1 2016-09-12 12:04:14 &lt;BR /&gt;
Laptop2 2016-09-12 10:00:45 &lt;BR /&gt;
Projector2 2016-09-11 03:13:04&lt;BR /&gt;
Projector1 2016-09-06 11:17:50&lt;/P&gt;

&lt;P&gt;from the 4 available devices, why you want these two devices(laptop1, projector2)?&lt;/P&gt;

&lt;P&gt;are there any other field values which will differentiate the laptops and projectors?&lt;BR /&gt;
are there any group names for laptops together?&lt;BR /&gt;
can you please give us the real devices names please? &lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2016 10:22:44 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2016-09-12T10:22:44Z</dc:date>
    <item>
      <title>Exclude result like the first result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274111#M82676</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
I want to identify the available and occupied resources in a pool. The active resource will have "Available" on the log and the occupied resource will have "taken" in the pool. &lt;BR /&gt;
(only 1 set of resource is always available and one set should always be taken i.e Laptop1 and Laptop2 cannot be available at the same time)&lt;/P&gt;

&lt;P&gt;Now when i do,&lt;BR /&gt;
&lt;STRONG&gt;source=sdesktop "Available" | stats count by resource, _time&lt;/STRONG&gt;&lt;BR /&gt;
resource      _time&lt;BR /&gt;
Laptop1     2016-09-12 12:04:14 &lt;BR /&gt;
Laptop2     2016-09-12 10:00:45 &lt;BR /&gt;
Projector2 2016-09-11  03:13:04&lt;BR /&gt;
Projector1 2016-09-06  11:17:50&lt;/P&gt;

&lt;P&gt;I want following result,&lt;BR /&gt;&lt;BR /&gt;
resource      _time&lt;BR /&gt;
Laptop1     2016-09-12 12:04:14 &lt;BR /&gt;
Projector2 2016-09-11  03:13:04&lt;/P&gt;

&lt;P&gt;I tried &lt;STRONG&gt;source=sdesktop "Available" | stats count by resource, _time  | sort - _time | head 2&lt;/STRONG&gt; &lt;BR /&gt;
resource      _time&lt;BR /&gt;
Laptop1     2016-09-12 12:04:14 &lt;BR /&gt;
Laptop2     2016-09-12 10:00:45 &lt;/P&gt;

&lt;P&gt;Please help. &lt;/P&gt;

&lt;P&gt;Thank you. &lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 03:11:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274111#M82676</guid>
      <dc:creator>dineshp</dc:creator>
      <dc:date>2016-09-12T03:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude result like the first result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274112#M82677</link>
      <description>&lt;P&gt;Hi Dinesh, can you please update us what is this "_time" clearly.. is it the device available "from time" ? &lt;BR /&gt;
Laptop1 2016-09-12 12:04:14 &lt;BR /&gt;
Laptop2 2016-09-12 10:00:45 &lt;BR /&gt;
Projector2 2016-09-11 03:13:04&lt;BR /&gt;
Projector1 2016-09-06 11:17:50&lt;/P&gt;

&lt;P&gt;from the 4 available devices, why you want these two devices(laptop1, projector2)?&lt;/P&gt;

&lt;P&gt;are there any other field values which will differentiate the laptops and projectors?&lt;BR /&gt;
are there any group names for laptops together?&lt;BR /&gt;
can you please give us the real devices names please? &lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 10:22:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274112#M82677</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-09-12T10:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude result like the first result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274113#M82678</link>
      <description>&lt;P&gt;Hi there inventsekar,&lt;/P&gt;

&lt;P&gt;Perhaps &lt;STRONG&gt;dedup&lt;/STRONG&gt; command can help you with this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=sdesktop "Available" | dedup resource | table resource _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 12:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274113#M82678</guid>
      <dc:creator>alemarzu</dc:creator>
      <dc:date>2016-09-12T12:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude result like the first result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274114#M82679</link>
      <description>&lt;P&gt;Hi inventsekar, &lt;BR /&gt;
Thank you for your reply. "_time" is the time when a resource gets free. I sorted the result with "_time" so i can grab the top two results. &lt;BR /&gt;
doing &lt;STRONG&gt;head&lt;/STRONG&gt; on the result gives me Laptop1 &amp;amp; Laptop2. But what i want is to grab one laptop and one projector after sorting them by time. &lt;BR /&gt;
Is there a way we can say "exclude the result similar to the first result" so anything that looks like "Laptop*" gets discarded and we only get projector. &lt;BR /&gt;
I found a work around using append command and running the search twice. &lt;BR /&gt;
*&lt;EM&gt;source=sdesktop "Available"  Laptop&lt;/EM&gt;| stats count by resource, _time | sort - _time | head 1 | append [search source=sdesktop "Available"  Projector*| stats count by resource, _time | sort - _time | head 1 ]&lt;BR /&gt;
 Result: &lt;BR /&gt;
resource _time&lt;BR /&gt;
Laptop1 2016-09-12 12:04:14 &lt;BR /&gt;
Projector2 2016-09-11 03:13:04&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:00:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274114#M82679</guid>
      <dc:creator>dineshp</dc:creator>
      <dc:date>2020-09-29T11:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude result like the first result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274115#M82680</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=sdesktop "Available" resource=Laptop* OR resource=Projector* | eval Type=if(match(resource,"Laptop"),"Laptop","Projector") | dedup Type | table resource _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Sep 2016 22:01:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274115#M82680</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-12T22:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude result like the first result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274116#M82681</link>
      <description>&lt;P&gt;hi Somesoni2, &lt;BR /&gt;
I tried your query, its only giving back "Laptop1"&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 23:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274116#M82681</guid>
      <dc:creator>dineshp</dc:creator>
      <dc:date>2016-09-12T23:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude result like the first result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274117#M82682</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source=sdesktop "Available" resource=Laptop* OR resource=Projector* | eval Type=if(match(resource, "Laptop"), "Laptop", "Projector") | stats latest(_time) as Time  last(resource) as Resource by Type | table Resource Time | eval Time=strftime(Time, "%x %X")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Sep 2016 00:26:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274117#M82682</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-13T00:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude result like the first result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274118#M82683</link>
      <description>&lt;P&gt;That's awesome, thank you sundareshr&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 00:48:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-result-like-the-first-result/m-p/274118#M82683</guid>
      <dc:creator>dineshp</dc:creator>
      <dc:date>2016-09-13T00:48:16Z</dc:date>
    </item>
  </channel>
</rss>

