<?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 How do I extract these events between two date ranges? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-these-events-between-two-date-ranges/m-p/616008#M106451</link>
    <description>&lt;P&gt;Hello!, First time posting here. Just started learning Splunk and I am trying to extract events between two date ranges&amp;nbsp; &amp;nbsp;4/6/2021 and 4/7/2021.&lt;/P&gt;
&lt;P&gt;I tried one of the earlier suggested answers which were&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SS_2.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21901i5C612D62440BA1B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="SS_2.png" alt="SS_2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SS_1.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21902iFC45C61EF64DCEB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="SS_1.png" alt="SS_1.png" /&gt;&lt;/span&gt;&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;
&lt;LI-CODE lang="markup"&gt;index="security" 
| eval Date="04/07/2021" 
| eval timestampDate=strptime(Date, "%m/%d/%Y") 
| eval timestampStart=strptime("04/06/2021", "%m/%d/%Y") 
| eval timestampEnd=strptime("04/07/2021", "%m/%d/%Y") 
| eval formattedTimestamp = strftime(timestamp,"%Y-%m-%dT%H:%M:%S") 
| where timestampDate &amp;gt;= timestampStart AND timestampDate &amp;lt;= timestampEnd&lt;/LI-CODE&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;
&lt;P&gt;and&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="security" | eval Date="4/7/2021" | where (strptime(Date, "%m/%d/%Y")&amp;gt;=strptime("4/6/2021", "%m/%d/%Y")) AND (strptime(Date, "%m/%d/%Y")&amp;lt;=strptime("4/7/2021", "%m/%d/%Y"))&lt;/LI-CODE&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;
&lt;P&gt;&amp;nbsp;But the queries return all the events available in the log file. Attaching the screenshots here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the sample from the index.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sample_event.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21903i3F31BB81B062F171/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sample_event.png" alt="Sample_event.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can someone please assist, thanks in advance.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2022 15:07:09 GMT</pubDate>
    <dc:creator>Saikarankot</dc:creator>
    <dc:date>2022-10-05T15:07:09Z</dc:date>
    <item>
      <title>How do I extract these events between two date ranges?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-these-events-between-two-date-ranges/m-p/616008#M106451</link>
      <description>&lt;P&gt;Hello!, First time posting here. Just started learning Splunk and I am trying to extract events between two date ranges&amp;nbsp; &amp;nbsp;4/6/2021 and 4/7/2021.&lt;/P&gt;
&lt;P&gt;I tried one of the earlier suggested answers which were&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SS_2.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21901i5C612D62440BA1B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="SS_2.png" alt="SS_2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SS_1.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21902iFC45C61EF64DCEB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="SS_1.png" alt="SS_1.png" /&gt;&lt;/span&gt;&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;
&lt;LI-CODE lang="markup"&gt;index="security" 
| eval Date="04/07/2021" 
| eval timestampDate=strptime(Date, "%m/%d/%Y") 
| eval timestampStart=strptime("04/06/2021", "%m/%d/%Y") 
| eval timestampEnd=strptime("04/07/2021", "%m/%d/%Y") 
| eval formattedTimestamp = strftime(timestamp,"%Y-%m-%dT%H:%M:%S") 
| where timestampDate &amp;gt;= timestampStart AND timestampDate &amp;lt;= timestampEnd&lt;/LI-CODE&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;
&lt;P&gt;and&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="security" | eval Date="4/7/2021" | where (strptime(Date, "%m/%d/%Y")&amp;gt;=strptime("4/6/2021", "%m/%d/%Y")) AND (strptime(Date, "%m/%d/%Y")&amp;lt;=strptime("4/7/2021", "%m/%d/%Y"))&lt;/LI-CODE&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;
&lt;P&gt;&amp;nbsp;But the queries return all the events available in the log file. Attaching the screenshots here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the sample from the index.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sample_event.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21903i3F31BB81B062F171/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sample_event.png" alt="Sample_event.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can someone please assist, thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 15:07:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-these-events-between-two-date-ranges/m-p/616008#M106451</guid>
      <dc:creator>Saikarankot</dc:creator>
      <dc:date>2022-10-05T15:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Events between two date ranges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-these-events-between-two-date-ranges/m-p/616010#M106453</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250090"&gt;@Saikarankot&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I suppose that you are not speaking of identify two dates using Time Picker.&lt;/P&gt;&lt;P&gt;In this case you can use something lie this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=security (earliest="10/03/2022:00:00:00" latest="10/05/2022:00:00:00")&lt;/LI-CODE&gt;&lt;P&gt;beware to the format of the timestamp!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 15:04:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-these-events-between-two-date-ranges/m-p/616010#M106453</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-05T15:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Events between two date ranges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-these-events-between-two-date-ranges/m-p/616433#M106506</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;. Apologies for the late response.&lt;/P&gt;&lt;P&gt;Thank you so much, this works.&amp;nbsp; I'm also curious why queries that I tried earlier didn't work.&amp;nbsp; Would you be able to shed some light on that?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Sai&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 08 Oct 2022 13:26:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-these-events-between-two-date-ranges/m-p/616433#M106506</guid>
      <dc:creator>Saikarankot</dc:creator>
      <dc:date>2022-10-08T13:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Events between two date ranges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-these-events-between-two-date-ranges/m-p/616435#M106507</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250090"&gt;@Saikarankot&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;probably the proble is in the format of those fields.&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Please accept one answer for the other people of Community&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2022 13:29:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-these-events-between-two-date-ranges/m-p/616435#M106507</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-08T13:29:35Z</dc:date>
    </item>
  </channel>
</rss>

