<?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 Splunk relative time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522772#M147428</link>
    <description>&lt;P&gt;Today is 10/2/2020. I need to execute 6 searches using &lt;EM&gt;relative&lt;/EM&gt; time for last month (earliest= &amp;amp; latest=) that are each 5 days in length.&lt;/P&gt;&lt;P&gt;Specifically:&lt;/P&gt;&lt;P&gt;9/01/2020:00:00:00 -&amp;nbsp;9/05/2020:23:59:59&lt;/P&gt;&lt;P&gt;9/06/2020:00:00:00 -&amp;nbsp;9/10/2020:23:59:59&lt;/P&gt;&lt;P&gt;9/11/2020:00:00:00 -&amp;nbsp;9/15/2020:23:59:59&lt;/P&gt;&lt;P&gt;9/16/2020:00:00:00 -&amp;nbsp;9/20/2020:23:59:59&lt;/P&gt;&lt;P&gt;9/21/2020:00:00:00 -&amp;nbsp;9/25/2020:23:59:59&lt;/P&gt;&lt;P&gt;9/26/2020:00:00:00 -&amp;nbsp;9/30/2020:23:59:59&lt;/P&gt;&lt;P&gt;I'd love to use these exact times as earliest/latest, or even epoch times, but that won't work in my particular situation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I represent the 6 spans above in &lt;STRONG&gt;relative&lt;/STRONG&gt; time?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 03 Oct 2020 05:08:43 GMT</pubDate>
    <dc:creator>jdmclemore</dc:creator>
    <dc:date>2020-10-03T05:08:43Z</dc:date>
    <item>
      <title>Splunk relative time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522772#M147428</link>
      <description>&lt;P&gt;Today is 10/2/2020. I need to execute 6 searches using &lt;EM&gt;relative&lt;/EM&gt; time for last month (earliest= &amp;amp; latest=) that are each 5 days in length.&lt;/P&gt;&lt;P&gt;Specifically:&lt;/P&gt;&lt;P&gt;9/01/2020:00:00:00 -&amp;nbsp;9/05/2020:23:59:59&lt;/P&gt;&lt;P&gt;9/06/2020:00:00:00 -&amp;nbsp;9/10/2020:23:59:59&lt;/P&gt;&lt;P&gt;9/11/2020:00:00:00 -&amp;nbsp;9/15/2020:23:59:59&lt;/P&gt;&lt;P&gt;9/16/2020:00:00:00 -&amp;nbsp;9/20/2020:23:59:59&lt;/P&gt;&lt;P&gt;9/21/2020:00:00:00 -&amp;nbsp;9/25/2020:23:59:59&lt;/P&gt;&lt;P&gt;9/26/2020:00:00:00 -&amp;nbsp;9/30/2020:23:59:59&lt;/P&gt;&lt;P&gt;I'd love to use these exact times as earliest/latest, or even epoch times, but that won't work in my particular situation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I represent the 6 spans above in &lt;STRONG&gt;relative&lt;/STRONG&gt; time?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2020 05:08:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522772#M147428</guid>
      <dc:creator>jdmclemore</dc:creator>
      <dc:date>2020-10-03T05:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk relative time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522775#M147429</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/24721"&gt;@jdmclemore&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: you want to count events in the period from&amp;nbsp;9/01/2020:00:00:00 to&amp;nbsp;9/30/2020:23:59:59 wiyj a span of 5 days, is it correct?&lt;/P&gt;&lt;P&gt;if this is your need, please, try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your search earliest="9/01/2020:00:00:00" latest="9/30/2020:23:59:59"
| timechart span=5d count&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2020 06:25:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522775#M147429</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-10-03T06:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk relative time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522788#M147434</link>
      <description>&lt;P&gt;Hi - thanks for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No, not counting events, just doing regular searches. But I'm wondering how you would represent each of those time spans with &lt;EM&gt;&lt;STRONG&gt;relative&lt;/STRONG&gt;&lt;/EM&gt; time notation instead of using the actual time. I know, it's a strange request...but can it be done?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2020 12:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522788#M147434</guid>
      <dc:creator>jdmclemore</dc:creator>
      <dc:date>2020-10-03T12:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk relative time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522821#M147444</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/24721"&gt;@jdmclemore&lt;/a&gt;&amp;nbsp;, you can use below notation for relative times&lt;/P&gt;&lt;P&gt;earliest=-30d@d latest=-25d@d&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2020 22:22:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522821#M147444</guid>
      <dc:creator>Nisha18789</dc:creator>
      <dc:date>2020-10-03T22:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk relative time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522833#M147448</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/24721"&gt;@jdmclemore&lt;/a&gt;&amp;nbsp;..&amp;nbsp;&lt;/P&gt;&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;suggested, for earliest and latest times, we can simply use the exact times as well.&lt;/P&gt;&lt;P&gt;(&lt;SPAN&gt;Use the&amp;nbsp;&lt;/SPAN&gt;earliest&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;latest&lt;SPAN&gt;&amp;nbsp;modifiers to specify custom and relative time ranges. You can specify an exact time such as&amp;nbsp;&lt;/SPAN&gt;earliest="10/5/2016:20:00:00"&lt;SPAN&gt;, or a relative time such as&amp;nbsp;&lt;/SPAN&gt;earliest=-h&lt;SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;latest=@w6&lt;SPAN&gt;.&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;or, to convert your required times to epoch, pls use this strptime command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval time1="9/01/2020:00:00:00" 
| eval time2="9/05/2020:23:59:59"
| eval epoch1=strptime(time1,"%m/%d/%Y:%H:%M:%S") 
| eval epoch2=strptime(time2,"%m/%d/%Y:%H:%M:%S") 
| table time1 time2 epoch1 epoch2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please check it:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="strptime.jpg" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/11103i92517B10FE189A6B/image-size/large?v=v2&amp;amp;px=999" role="button" title="strptime.jpg" alt="strptime.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(PS - i have given around 500+ karma points so far, received badge for that, if an answer helped you, a karma point would be nice!. we all should start "Learn, Give Back, Have Fun")&lt;/P&gt;</description>
      <pubDate>Sun, 04 Oct 2020 03:53:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522833#M147448</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-10-04T03:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk relative time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522834#M147449</link>
      <description>&lt;P&gt;now=10/3/20 11:08:48.000 PM&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/215670"&gt;@Nisha18789&lt;/a&gt;&amp;nbsp;.. the idea was good.. but it may give some issues:&lt;BR /&gt;index=ioc earliest=-30d@d latest=-25d@d&lt;BR /&gt;(you can open the inspect job and see the exact timeframe which was applied for your search)&lt;/P&gt;&lt;PRE&gt;9/3/20 12:00:00.000 AM - 9/8/20 12:00:00.000 AM&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/24721"&gt;@jdmclemore&lt;/a&gt;&amp;nbsp;...&amp;nbsp;Please try these methods:&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=ioc earliest=-1mon@mon latest=-1mon@+2d@d&lt;BR /&gt;(you can open the inspect job and see the exact timeframe which was applied for your search)&lt;/P&gt;&lt;PRE&gt;9/1/20 12:00:00.000 AM - 9/5/20 12:00:00.000 AM&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;index=ioc earliest=-1mon@+2d@d latest=-1mon@+7d@d&lt;/P&gt;&lt;PRE&gt;9/5/20 12:00:00.000 AM - 9/10/20 12:00:00.000 AM&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Oct 2020 05:19:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/522834#M147449</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-10-04T05:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk relative time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/523191#M147564</link>
      <description>&lt;P&gt;That's what I was looking for - thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 13:48:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-relative-time/m-p/523191#M147564</guid>
      <dc:creator>jdmclemore</dc:creator>
      <dc:date>2020-10-06T13:48:32Z</dc:date>
    </item>
  </channel>
</rss>

