<?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: Time difference between last event and now in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611937#M212759</link>
    <description>&lt;P&gt;The dedup will mean you will only get one result per agentComputerName - if you want the other dates, you should&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| dedup agentComputerName installedAt&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 05 Sep 2022 11:18:16 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-09-05T11:18:16Z</dc:date>
    <item>
      <title>How to search for the time difference between last event and now?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611911#M212741</link>
      <description>&lt;P&gt;I have &lt;STRONG&gt;installedAt&lt;/STRONG&gt; field which gives the application's installation time.&lt;/P&gt;
&lt;P&gt;If I run a Splunk search for the last 7 days it shows the application installed at different times.&lt;/P&gt;
&lt;P&gt;So I want the query to find the applications installed in the last 7 days.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alexspunkshell_1-1662371661439.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21310i38568AA254F615C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alexspunkshell_1-1662371661439.png" alt="alexspunkshell_1-1662371661439.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 22:03:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611911#M212741</guid>
      <dc:creator>alexspunkshell</dc:creator>
      <dc:date>2022-09-05T22:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference between last event and now</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611917#M212744</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/126376"&gt;@alexspunkshell&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could run a search like the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| eval duration=tostring(now()-strptime(InstalledAt,"%Y-%m-%dT%H:%M:%S.%6N"),"duration")
| table _time InstalledAt duration&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 10:10:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611917#M212744</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-05T10:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference between last event and now</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611927#M212751</link>
      <description>&lt;P&gt;You appear to have two different time formats in use - try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where now()-coalesce(strptime(installedAt,"%Y-%m-%dT%H:%M:%S.%6N%Z"),strptime(installedAt,"%Y-%m-%dT%H:%M:%S%Z")) &amp;lt; (60*60*24*7)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Sep 2022 10:36:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611927#M212751</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-09-05T10:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference between last event and now</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611928#M212752</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;Tried using the queries. But no results.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 10:40:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611928#M212752</guid>
      <dc:creator>alexspunkshell</dc:creator>
      <dc:date>2022-09-05T10:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference between last event and now</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611930#M212754</link>
      <description>&lt;P&gt;Given that your example times are 4-5 years ago, could it be that you haven't had any installs in the last 7 days?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 10:45:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611930#M212754</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-09-05T10:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference between last event and now</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611931#M212755</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/126376"&gt;@alexspunkshell&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;there are two choices:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;said, there isn't any event,&lt;/LI&gt;&lt;LI&gt;check how it's written installedAt field name: field names are case sensitive.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 10:48:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611931#M212755</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-05T10:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference between last event and now</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611934#M212757</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; I have new installs but the query is updating the latest time to all results and showing all the results. Here I need the installation that occurred over the past 7 days.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alexspunkshell_0-1662374944691.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21315i635968D4DBD39F6F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alexspunkshell_0-1662374944691.png" alt="alexspunkshell_0-1662374944691.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 10:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611934#M212757</guid>
      <dc:creator>alexspunkshell</dc:creator>
      <dc:date>2022-09-05T10:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference between last event and now</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611937#M212759</link>
      <description>&lt;P&gt;The dedup will mean you will only get one result per agentComputerName - if you want the other dates, you should&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| dedup agentComputerName installedAt&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Sep 2022 11:18:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611937#M212759</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-09-05T11:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference between last event and now</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611946#M212762</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Though I gave &lt;STRONG&gt;| search duration &amp;lt;7+&amp;nbsp;&lt;/STRONG&gt;condition, I am getting results other results. How to exclude the results within 7 days.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alexspunkshell_0-1662378568846.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21316iF2AD95D8D0CE43F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alexspunkshell_0-1662378568846.png" alt="alexspunkshell_0-1662378568846.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 11:52:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611946#M212762</guid>
      <dc:creator>alexspunkshell</dc:creator>
      <dc:date>2022-09-05T11:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference between last event and now</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611952#M212767</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/126376"&gt;@alexspunkshell&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;add, at the end of the search, a condition that excludes durations less than 7 days (604,800 seconds):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| eval duration=now()-strptime(InstalledAt,"%Y-%m-%dT%H:%M:%S.%6N")
| where duration&amp;gt;604800
| eval duration=tostring(duration,"duration")
| table _time InstalledAt duration&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 12:19:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-the-time-difference-between-last-event-and-now/m-p/611952#M212767</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-05T12:19:07Z</dc:date>
    </item>
  </channel>
</rss>

