<?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: Manipulate _time value on collect in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Manipulate-time-value-on-collect/m-p/325973#M97184</link>
    <description>&lt;P&gt;After more tests and playing around with the query I've noticed that if I &lt;STRONG&gt;remove the earliest and latest parameters and select the time range I wanted using the time picker&lt;/STRONG&gt;, it works as intended.&lt;/P&gt;

&lt;P&gt;This is fine if I'm retrieving data from a single index or if I am retrieving data within the same interval.&lt;BR /&gt;
I'm wondering how could it be done if I wanted an entire week data from one of the sources and only data from the previous day on another, I couldn't set this up only using the time picker.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2018 17:16:30 GMT</pubDate>
    <dc:creator>LordLeet</dc:creator>
    <dc:date>2018-01-24T17:16:30Z</dc:date>
    <item>
      <title>Manipulate _time value on collect</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Manipulate-time-value-on-collect/m-p/325972#M97183</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm performing  some aggregations on my indexed data and I'm doing them based on a field that stores date and time (action_time), the stored dates may also be from previous days.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=index_1 (filtering conditions) earliest=-1d@d latest=@d&lt;BR /&gt;
| eval action_time=strptime(action_time,"%d/%m/%Y %H:%M:%S")&lt;BR /&gt;
| stats (aggregation)  by action_time &lt;BR /&gt;
| eval _time=action_time&lt;BR /&gt;
| fields _time action_time (aggregation results)&lt;BR /&gt;
| collect index=collect_index&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;If I perform the search shown above, it retrieves the desired results for the _time field on the search results but if I run the query over the collected data the _time field will be wrong.&lt;BR /&gt;
It seems the issue might be related with the earliest and latest since what is being displayed on the _time field is 1/23/18 11:59:59.000 PM which seems to be the last possible value for _time within the specified interval.&lt;/P&gt;

&lt;P&gt;For instance:&lt;BR /&gt;
&lt;STRONG&gt;Before Collect _time:&lt;/STRONG&gt; 2018-01-20 00:00:57&lt;BR /&gt;
&lt;STRONG&gt;After Collect _time:&lt;/STRONG&gt; 1/23/18 11:59:59.000 PM&lt;/P&gt;

&lt;P&gt;I've also tried replacing the &lt;STRONG&gt;| fields&lt;/STRONG&gt; with the &lt;STRONG&gt;| table&lt;/STRONG&gt; command to get rid of internal fields,  playing with the &lt;STRONG&gt;| collect addtime&lt;/STRONG&gt; parameter,  both with no success.&lt;/P&gt;

&lt;P&gt;Am I missing something?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 16:11:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Manipulate-time-value-on-collect/m-p/325972#M97183</guid>
      <dc:creator>LordLeet</dc:creator>
      <dc:date>2018-01-24T16:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulate _time value on collect</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Manipulate-time-value-on-collect/m-p/325973#M97184</link>
      <description>&lt;P&gt;After more tests and playing around with the query I've noticed that if I &lt;STRONG&gt;remove the earliest and latest parameters and select the time range I wanted using the time picker&lt;/STRONG&gt;, it works as intended.&lt;/P&gt;

&lt;P&gt;This is fine if I'm retrieving data from a single index or if I am retrieving data within the same interval.&lt;BR /&gt;
I'm wondering how could it be done if I wanted an entire week data from one of the sources and only data from the previous day on another, I couldn't set this up only using the time picker.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 17:16:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Manipulate-time-value-on-collect/m-p/325973#M97184</guid>
      <dc:creator>LordLeet</dc:creator>
      <dc:date>2018-01-24T17:16:30Z</dc:date>
    </item>
  </channel>
</rss>

