<?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: Display deleted events between 2 scheduled searches in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150541#M42182</link>
    <description>&lt;P&gt;What search are you using? Also, what do you see if you enter&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;yoursearchhere&lt;BR /&gt;
| table _time ServerName&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 May 2014 20:12:47 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2014-05-02T20:12:47Z</dc:date>
    <item>
      <title>Display deleted events between 2 scheduled searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150538#M42179</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Hoping you can help me out here. &lt;/P&gt;

&lt;P&gt;I have a ps input indexing daily AD computer objects to Splunk. The scripted input is set to execute daily. Output is in the following manner : &lt;/P&gt;

&lt;P&gt;2014/04/29 11:46:39  ServerName="am-dc02" ADSPath="CN=am-dc02,OU=Domain Controllers,DC=ads,DC=contoso,DC=com" Created="04/28/2014 12:34:36"&lt;BR /&gt;
2014/04/29 11:46:39  ServerName="am-dc01" ADSPath="CN=am-dc01,OU=Domain Controllers,DC=ads,DC=contoso,DC=com" Created="04/28/2014 12:34:01"&lt;/P&gt;

&lt;P&gt;I am having difficulties displaying AD Computer objects that got deleted in the last 1 day, last 7 days and last 30 days period. &lt;BR /&gt;
For eg if the search that ran yesterday indexed 2 AD computer objects and the next run of the scripted input indexed only 1 AD computer obj : &lt;BR /&gt;
2014/04/29 11:46:39  ServerName="am-dc01" ADSPath="CN=am-dc01,OU=Domain Controllers,DC=ads,DC=contoso,DC=com" Created="04/28/2014 12:34:01"&lt;/P&gt;

&lt;P&gt;How do I list the AD computer object that got deleted when the scripted input ran today ? As I am not including isDeleted AD object property, I have to rely on the time stamp that is written at the start of each event in the output. This is the logic i am using while building the search.&lt;/P&gt;

&lt;P&gt;I search for current time - 1 day and get the results displayed. Then I make a sub search for displaying the results of the current day. Then I am using the diff command to get the results. however that does not work at all. Can somebody please help me ? THank you.&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 15:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150538#M42179</guid>
      <dc:creator>saurabhkunte</dc:creator>
      <dc:date>2014-05-02T15:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Display deleted events between 2 scheduled searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150539#M42180</link>
      <description>&lt;P&gt;Couldn't you do this? The following example is for a single day.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere earliest=-1d@d
| stats count by ServerName
| where count &amp;lt; 2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For an arbitrary number of days, this might be better:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| stats count range(_time) as range earliest(_time) as firstSeenOn latest(_time) as lastSeenOn by ServerName
| eval numDays = round(range/86400,0)
| where count &amp;lt; numDays
| table ServerName firstSeenOn lastSeenOn
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or even&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| stats latest(_time) as lastSeenOn by ServerName
| eval lastSeenOn = relative_time(lastSeenOn,"@d")
| eval today = relative_time(now(),"@d")
| where lastSeenOn &amp;lt; today
| fields - today
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 May 2014 16:37:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150539#M42180</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-05-02T16:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Display deleted events between 2 scheduled searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150540#M42181</link>
      <description>&lt;P&gt;Thanks for you reply. &lt;/P&gt;

&lt;P&gt;However none of these searches display any results. It says  there are few matching events, but it does not display the results. I tried breaking up the search strings you provided but I am unable to figure out why the search does not return any results.&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 17:47:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150540#M42181</guid>
      <dc:creator>saurabhkunte</dc:creator>
      <dc:date>2014-05-02T17:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Display deleted events between 2 scheduled searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150541#M42182</link>
      <description>&lt;P&gt;What search are you using? Also, what do you see if you enter&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;yoursearchhere&lt;BR /&gt;
| table _time ServerName&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 20:12:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150541#M42182</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-05-02T20:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Display deleted events between 2 scheduled searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150542#M42183</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;P&gt;AD objects deleted in last 1 day&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...your base search... earliest=-1d@d latest=@d NOT [search ...your base search...earliest=@d | stats count by ServerName,ADSPath | table  ServerName,ADSPath | format]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should give you all the AD groups that were present yesterday but not today.&lt;/P&gt;

&lt;P&gt;Similarly change the earliest to "-7d@d" and "-30d@d" in the base search (not subsearch) to get object that were present in last 7days/30 days but not today.&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 20:17:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150542#M42183</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-05-02T20:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Display deleted events between 2 scheduled searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150543#M42184</link>
      <description>&lt;P&gt;Thanks Soni,&lt;/P&gt;

&lt;P&gt;This search of yours works. Its just a bit slow to disaply results, but that would be coz the query making 2 searches against 2 different time frames.&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 21:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150543#M42184</guid>
      <dc:creator>saurabhkunte</dc:creator>
      <dc:date>2014-05-02T21:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Display deleted events between 2 scheduled searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150544#M42185</link>
      <description>&lt;P&gt;Or remove the &lt;CODE&gt;where&lt;/CODE&gt; commands and see what you get&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 23:19:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-deleted-events-between-2-scheduled-searches/m-p/150544#M42185</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-05-02T23:19:42Z</dc:date>
    </item>
  </channel>
</rss>

