<?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 Can't search modified _time value using earliest/latest requests. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-t-search-modified-time-value-using-earliest-latest-requests/m-p/546285#M154850</link>
    <description>&lt;P&gt;I ran into a timeformatting issue with some of my logs due to the string starting with the following time format resulting in the indexing of months of events as a 24 hour clock (AM/PM events are both in the same 12 hour time frame.&lt;BR /&gt;"&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;26-Mar-2021&lt;/SPAN&gt; &lt;SPAN class="t"&gt;12:59:56&lt;/SPAN&gt; &lt;SPAN class="t"&gt;o&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN class="t"&gt;clock&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;&lt;SPAN class="t"&gt;AM&lt;/SPAN&gt; &lt;SPAN class="t"&gt;MDT&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Error&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;......"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am trying to run a search based on a dashboard panel that is using the make results command to gather the index times that are +- 12 hours surrounding the event i am searching, i then use rex and formatting to try to correct the _time to proper AM/PM values, this appears to work up to the point before the "| search" command.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am unable to use earliest/latest values to do a second time bounded search on the corrected time stamps. I am hoping someone can offer some advice of how to fix the time stamps to properly reflect _time values, and then search those results for a subset of events to report on.&lt;BR /&gt;&lt;BR /&gt;.conf files have already been updated to fix the _time when indexed moving forward, i am just stuck trying to evaluate the older data.&lt;BR /&gt;&lt;BR /&gt;Data/duration are example data (these are populated by drilldown options via a dashboard)&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=myindex source=mysource [ 
  | makeresults 
  | eval duration="00:16:35"
  | eval earliest=round(strptime("2021/03/24 11:23:90","%Y/%m/%d %H:%M:%S")-43200)
  | rex field=duration "(?&amp;lt;hour&amp;gt;\d*?):(?&amp;lt;min&amp;gt;\d*?):(?&amp;lt;sec&amp;gt;\d*)"
  | eval latest=earliest+(hour*3600)+(min*60)+sec+43200
  | dedup earliest,latest
  | table earliest,latest
  | format
]
| rex "^&amp;lt;(?&amp;lt;raw_time&amp;gt;.*?)&amp;gt;.*" 
| eval _time=strptime(raw_time,"%d-%b-%Y %I:%M:%S o'clock %p %Z") 
| search [ 
  | makeresults 
  | eval duration="00:16:35"
  | eval earliest=round(strptime("2021/03/24 11:23:90","%Y/%m/%d %H:%M:%S"))
  | rex field=duration "(?&amp;lt;hour&amp;gt;\d*?):(?&amp;lt;min&amp;gt;\d*?):(?&amp;lt;sec&amp;gt;\d*)"
  | eval latest=earliest+(hour*3600)+(min*60)+sec
  | dedup earliest,latest
  | table earliest,latest
  | format
]&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;</description>
    <pubDate>Wed, 31 Mar 2021 18:48:38 GMT</pubDate>
    <dc:creator>rlaan</dc:creator>
    <dc:date>2021-03-31T18:48:38Z</dc:date>
    <item>
      <title>Can't search modified _time value using earliest/latest requests.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-search-modified-time-value-using-earliest-latest-requests/m-p/546285#M154850</link>
      <description>&lt;P&gt;I ran into a timeformatting issue with some of my logs due to the string starting with the following time format resulting in the indexing of months of events as a 24 hour clock (AM/PM events are both in the same 12 hour time frame.&lt;BR /&gt;"&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;26-Mar-2021&lt;/SPAN&gt; &lt;SPAN class="t"&gt;12:59:56&lt;/SPAN&gt; &lt;SPAN class="t"&gt;o&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN class="t"&gt;clock&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;&lt;SPAN class="t"&gt;AM&lt;/SPAN&gt; &lt;SPAN class="t"&gt;MDT&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Error&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;......"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am trying to run a search based on a dashboard panel that is using the make results command to gather the index times that are +- 12 hours surrounding the event i am searching, i then use rex and formatting to try to correct the _time to proper AM/PM values, this appears to work up to the point before the "| search" command.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am unable to use earliest/latest values to do a second time bounded search on the corrected time stamps. I am hoping someone can offer some advice of how to fix the time stamps to properly reflect _time values, and then search those results for a subset of events to report on.&lt;BR /&gt;&lt;BR /&gt;.conf files have already been updated to fix the _time when indexed moving forward, i am just stuck trying to evaluate the older data.&lt;BR /&gt;&lt;BR /&gt;Data/duration are example data (these are populated by drilldown options via a dashboard)&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=myindex source=mysource [ 
  | makeresults 
  | eval duration="00:16:35"
  | eval earliest=round(strptime("2021/03/24 11:23:90","%Y/%m/%d %H:%M:%S")-43200)
  | rex field=duration "(?&amp;lt;hour&amp;gt;\d*?):(?&amp;lt;min&amp;gt;\d*?):(?&amp;lt;sec&amp;gt;\d*)"
  | eval latest=earliest+(hour*3600)+(min*60)+sec+43200
  | dedup earliest,latest
  | table earliest,latest
  | format
]
| rex "^&amp;lt;(?&amp;lt;raw_time&amp;gt;.*?)&amp;gt;.*" 
| eval _time=strptime(raw_time,"%d-%b-%Y %I:%M:%S o'clock %p %Z") 
| search [ 
  | makeresults 
  | eval duration="00:16:35"
  | eval earliest=round(strptime("2021/03/24 11:23:90","%Y/%m/%d %H:%M:%S"))
  | rex field=duration "(?&amp;lt;hour&amp;gt;\d*?):(?&amp;lt;min&amp;gt;\d*?):(?&amp;lt;sec&amp;gt;\d*)"
  | eval latest=earliest+(hour*3600)+(min*60)+sec
  | dedup earliest,latest
  | table earliest,latest
  | format
]&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;</description>
      <pubDate>Wed, 31 Mar 2021 18:48:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-search-modified-time-value-using-earliest-latest-requests/m-p/546285#M154850</guid>
      <dc:creator>rlaan</dc:creator>
      <dc:date>2021-03-31T18:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can't search modified _time value using earliest/latest requests.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-search-modified-time-value-using-earliest-latest-requests/m-p/546347#M154874</link>
      <description>&lt;P&gt;This looks like a bug to me - the documentation seems to imply that time modifiers should work with the search command, however, they don't appear to be being parsed correctly (at least I couldn't see it in my job log).&lt;/P&gt;&lt;P&gt;To work around this, you could use the where command instead but you would need to calculate values for _time in order to get this to work.&lt;/P&gt;&lt;P&gt;Try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex source=mysource [ 
  | makeresults 
  | eval duration="00:16:35"
  | eval earliest=round(strptime("2021/03/24 11:23:90","%Y/%m/%d %H:%M:%S")-43200)
  | rex field=duration "(?&amp;lt;hour&amp;gt;\d*?):(?&amp;lt;min&amp;gt;\d*?):(?&amp;lt;sec&amp;gt;\d*)"
  | eval latest=earliest+(hour*3600)+(min*60)+sec+43200
  | dedup earliest,latest
  | table earliest,latest
  | format
]
| rex "^&amp;lt;(?&amp;lt;raw_time&amp;gt;.*?)&amp;gt;.*" 
| eval _time=strptime(raw_time,"%d-%b-%Y %I:%M:%S o'clock %p %Z") 
| where _time&amp;gt;=strptime("2021/03/24 11:23:90","%Y/%m/%d %H:%M:%S") AND _time&amp;lt;=strptime("2021/03/24 11:23:90","%Y/%m/%d %H:%M:%S")+(tonumber(substr("00:16:35",1,2))*60+tonumber(substr("00:16:35",4,2)))*60+tonumber(substr("00:16:35",7,2))&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Apr 2021 09:20:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-search-modified-time-value-using-earliest-latest-requests/m-p/546347#M154874</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-04-01T09:20:34Z</dc:date>
    </item>
  </channel>
</rss>

