<?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: Search with _time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579821#M202035</link>
    <description>&lt;P&gt;if you dont want to use time-picker, can you use earliest and latest pls:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="tickets" host="host_1"  earliest="02/01/2021:00:00:00" latest="01/01/2022:00:00:00"
| foreach * [ eval newFieldName=replace("&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;", "\s+", "_"),  {newFieldName}='&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'  ] | fields - "* *", newFieldName
| eval CreatedDateParsed=strptime(Created_Date, "%Y-%m-%d %H:%M:%S") 
| sort 0 -CreatedDateParsed
| addinfo
| where CreatedDateParsed&amp;gt;=info_min_time AND (CreatedDateParsed&amp;lt;=info_max_time OR info_max_time="+Infinity") 
| dedup ID
| where Status!="Closed"
| eval min_time=strftime(info_min_time, "%Y-%m-%d %H:%M:%S")
| eval max_time=strftime(info_max_time, "%Y-%m-%d %H:%M:%S")
| eval index_time=strftime(_indextime, "%Y-%m-%d %H:%M:%S")
| rename Created_Date as Created, Last_Updated_Date as "Last Updated" 
| table _time CreatedDateParsed ID Type Created "Last Updated" min_time info_min_time max_time info_max_time index_time
| sort 0 Created&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jan 2022 01:56:31 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2022-01-04T01:56:31Z</dc:date>
    <item>
      <title>Search with _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579673#M201983</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am monitoring a csv file using universal forwarder and the first column in the csv file is Last_Updated_Date. This file is indexed based on this field (_time = Last_Updated_Date).&lt;/P&gt;&lt;P&gt;This file also has a column called Created_Date. While writing a search, I want to use Created_Date as _time to filter the data and the search I have written is given below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="tickets" host="host_1"  
| foreach * [ eval newFieldName=replace("&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;", "\s+", "_"),  {newFieldName}='&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'  ] | fields - "* *", newFieldName
| eval _time=strptime(Created_Date, "%Y-%m-%d %H:%M:%S") 
| sort 0 -_time
| addinfo
| where _time&amp;gt;=info_min_time AND (_time&amp;lt;=info_max_time OR info_max_time="+Infinity") 
| dedup ID
| where Status!="Closed"
| eval min_time=strftime(info_min_time, "%Y-%m-%d %H:%M:%S")
| eval max_time=strftime(info_max_time, "%Y-%m-%d %H:%M:%S")
| eval index_time=strftime(_indextime, "%Y-%m-%d %H:%M:%S")
| rename Created_Date as Created, Last_Updated_Date as "Last Updated" 
| table ID Type Created "Last Updated" _time min_time info_min_time max_time info_max_time index_time
| sort 0 Created&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;When I run this search for a period, say 1st Feb 2021 - 31st Jul 2021, it gives results as below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="madhav_dholakia_1-1640942625066.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17388i7B4C0DF61F14CD48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="madhav_dholakia_1-1640942625066.png" alt="madhav_dholakia_1-1640942625066.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I checked this for a longer period, say All Time - it gives results as below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="madhav_dholakia_2-1640942703670.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17389iA26AA2A4CD511E94/image-size/medium?v=v2&amp;amp;px=400" role="button" title="madhav_dholakia_2-1640942703670.png" alt="madhav_dholakia_2-1640942703670.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There are many open tickets (created between Feb and Jul) and not just two, as shown in the first screenshot, but it seems still the timepicker is using Last_Updated_Date to filter the events and not the Created_Date.&lt;/P&gt;&lt;P&gt;Can you please suggest how I can fix this?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 09:28:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579673#M201983</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2021-12-31T09:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Search with _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579684#M201985</link>
      <description>&lt;P&gt;Search from 1 Feb until now, that way you will get events including the creation event and any subsequent updates. You can then filter on create date between 1 Feb and 31 Jul&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 10:56:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579684#M201985</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-12-31T10:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Search with _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579694#M201990</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/65114"&gt;@madhav_dholakia&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as per my understanding, its not a best practice to eval something to "_time" (as _time is an system internal field).. so lets have it as "CreatedDateParsed". may we know what happens with this query please:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="tickets" host="host_1"  
| foreach * [ eval newFieldName=replace("&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;", "\s+", "_"),  {newFieldName}='&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'  ] | fields - "* *", newFieldName
| eval CreatedDateParsed=strptime(Created_Date, "%Y-%m-%d %H:%M:%S") 
| sort 0 -CreatedDateParsed
| addinfo
| where CreatedDateParsed&amp;gt;=info_min_time AND (CreatedDateParsed&amp;lt;=info_max_time OR info_max_time="+Infinity") 
| dedup ID
| where Status!="Closed"
| eval min_time=strftime(info_min_time, "%Y-%m-%d %H:%M:%S")
| eval max_time=strftime(info_max_time, "%Y-%m-%d %H:%M:%S")
| eval index_time=strftime(_indextime, "%Y-%m-%d %H:%M:%S")
| rename Created_Date as Created, Last_Updated_Date as "Last Updated" 
| table ID Type Created "Last Updated" _time min_time info_min_time max_time info_max_time index_time
| sort 0 Created&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and what happens when you have this table at the last...&lt;/P&gt;&lt;P&gt;| table _time ID Type Created "Last Updated" _time min_time info_min_time max_time info_max_time index_time&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 13:10:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579694#M201990</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2021-12-31T13:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Search with _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579772#M202015</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;- I want to avoid searching for All Time or a longer period than the actual event period (based on created date) I am interested with. This because the huge data we have in this index.&lt;/P&gt;&lt;P&gt;For example, if I am looking for tickets created between March 2021 and May 2021, I do not want to use time picker from March 2021 until now.&lt;/P&gt;&lt;P&gt;Using the time picker range as Feb 2021 to Till Date - is this the only option I have in this use case?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 07:19:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579772#M202015</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2022-01-03T07:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Search with _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579774#M202016</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp;- I have used below query with time picker value between Feb, 2021 to Jul 2021, it gives 7 events but there are more than 30 open tickets created between Feb 2021 and Jul 2021.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="tickets" host="host_1"  
| foreach * [ eval newFieldName=replace("&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;", "\s+", "_"),  {newFieldName}='&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'  ] | fields - "* *", newFieldName
| eval CreatedDateParsed=strptime(Created_Date, "%Y-%m-%d %H:%M:%S") 
| sort 0 -CreatedDateParsed
| addinfo
| where CreatedDateParsed&amp;gt;=info_min_time AND (CreatedDateParsed&amp;lt;=info_max_time OR info_max_time="+Infinity") 
| dedup ID
| where Status!="Closed"
| eval min_time=strftime(info_min_time, "%Y-%m-%d %H:%M:%S")
| eval max_time=strftime(info_max_time, "%Y-%m-%d %H:%M:%S")
| eval index_time=strftime(_indextime, "%Y-%m-%d %H:%M:%S")
| rename Created_Date as Created, Last_Updated_Date as "Last Updated" 
| table _time CreatedDateParsed ID Type Created "Last Updated" min_time info_min_time max_time info_max_time index_time
| sort 0 Created&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="madhav_dholakia_0-1641194251316.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17402iC944BFC1A6754348/image-size/medium?v=v2&amp;amp;px=400" role="button" title="madhav_dholakia_0-1641194251316.png" alt="madhav_dholakia_0-1641194251316.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Using the time picker range as Feb 2021 to Till Date - is this the only option I have in this use case?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 07:18:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579774#M202016</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2022-01-03T07:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Search with _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579784#M202021</link>
      <description>&lt;P&gt;Create a second index (possibly a summary index) which is based on create time rather than event time.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 09:53:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579784#M202021</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-03T09:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Search with _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579821#M202035</link>
      <description>&lt;P&gt;if you dont want to use time-picker, can you use earliest and latest pls:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="tickets" host="host_1"  earliest="02/01/2021:00:00:00" latest="01/01/2022:00:00:00"
| foreach * [ eval newFieldName=replace("&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;", "\s+", "_"),  {newFieldName}='&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'  ] | fields - "* *", newFieldName
| eval CreatedDateParsed=strptime(Created_Date, "%Y-%m-%d %H:%M:%S") 
| sort 0 -CreatedDateParsed
| addinfo
| where CreatedDateParsed&amp;gt;=info_min_time AND (CreatedDateParsed&amp;lt;=info_max_time OR info_max_time="+Infinity") 
| dedup ID
| where Status!="Closed"
| eval min_time=strftime(info_min_time, "%Y-%m-%d %H:%M:%S")
| eval max_time=strftime(info_max_time, "%Y-%m-%d %H:%M:%S")
| eval index_time=strftime(_indextime, "%Y-%m-%d %H:%M:%S")
| rename Created_Date as Created, Last_Updated_Date as "Last Updated" 
| table _time CreatedDateParsed ID Type Created "Last Updated" min_time info_min_time max_time info_max_time index_time
| sort 0 Created&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 01:56:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/579821#M202035</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2022-01-04T01:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Search with _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/581292#M202519</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp;- if I understand correctly, using earliest &amp;amp; latest is another way of setting the time picker (with a precedence over time picker range), isn't it? In this case, it will still look for the data starting from Jan 2021 to Jan 2022 and will be (almost) same performance as using time picker?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to avoid searching for All Time or a longer period than the actual event period (based on created date) I am interested with. This because the huge data we have in this index.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jan 2022 08:14:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-with-time/m-p/581292#M202519</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2022-01-17T08:14:38Z</dc:date>
    </item>
  </channel>
</rss>

