<?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: Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486115#M136004</link>
    <description>&lt;P&gt;Yes, I copied and pasted it from here.&lt;/P&gt;

&lt;P&gt;I see now it needs to have the  "earliest=0 latest=now" removed for this to work.&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Nov 2019 16:57:35 GMT</pubDate>
    <dc:creator>andimnf</dc:creator>
    <dc:date>2019-11-18T16:57:35Z</dc:date>
    <item>
      <title>Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486105#M135994</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I need to perform a timechart count for a particular field. The dates in the field aren't related to the timestamp the log was received and can go back to dates a few years ago, and so I overwrite the _time and convert the field to epoch. This works well and the figures in the graph are accurate. However if I try and select the timeframe for 'last 7 days' or 'last 30 days' for example the timechart still shows all entries including those going back to 2017.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=example sourcetye=examplesource| eval epoch_logged_time=strptime('Date Logged',"%d/%m/%Y") | eval _time=epoch_logged_time | timechart count span=7d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What's going on here?&lt;/P&gt;

&lt;P&gt;TIA&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2019 11:25:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486105#M135994</guid>
      <dc:creator>andimnf</dc:creator>
      <dc:date>2019-11-16T11:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486106#M135995</link>
      <description>&lt;P&gt;I see now that the timeframe is created before the eval overwrites the _time field.&lt;/P&gt;

&lt;P&gt;is there anything I can do here to show specific times?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2019 11:51:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486106#M135995</guid>
      <dc:creator>andimnf</dc:creator>
      <dc:date>2019-11-16T11:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486107#M135996</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=example sourcetye=examplesource earliest=0 latest=now
| eval epoch_logged_time=strptime('Date Logged',"%d/%m/%Y")
| eval _time=epoch_logged_time
| addinfo
| where ((_time &amp;gt;= info_min_time) AND (_time=="+Infinity" OR _time&amp;lt;=info_max_time))
| timechart fixedrange=f count span=7d
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Nov 2019 02:24:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486107#M135996</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-17T02:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486108#M135997</link>
      <description>&lt;P&gt;Thanks, but I get errors on the +Infinity value. I tried swapping that out for 'now' but it still just displays all time.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 08:42:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486108#M135997</guid>
      <dc:creator>andimnf</dc:creator>
      <dc:date>2019-11-17T08:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486109#M135998</link>
      <description>&lt;P&gt;So I got this to do what I wanted using the following search. It's not the prettiest so I'm still wondering if there's a better way.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval epoch_logged_time=strptime('Date Logged',"%d/%m/%Y")  | eval _time=epoch_logged_time | where _time&amp;gt;now()-7257600 | timechart count span=7d
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Nov 2019 09:27:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486109#M135998</guid>
      <dc:creator>andimnf</dc:creator>
      <dc:date>2019-11-17T09:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486110#M135999</link>
      <description>&lt;P&gt;You also need &lt;CODE&gt;fixedrange=false&lt;/CODE&gt;. I updated my answer. &lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 14:28:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486110#M135999</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-17T14:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486111#M136000</link>
      <description>&lt;P&gt;Try my updated answer. It should do exactly what you need as selected by the &lt;CODE&gt;Time picker&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 14:31:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486111#M136000</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-17T14:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486112#M136001</link>
      <description>&lt;P&gt;Thanks again. This still isn't taking the input from the timepicker and is just showing all dates.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 09:09:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486112#M136001</guid>
      <dc:creator>andimnf</dc:creator>
      <dc:date>2019-11-18T09:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486113#M136002</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults count=2 
| streamstats count 
| eval _time = if (count==2,relative_time(_time,"-2y@d"), relative_time(_time,"@d")) 
| makecontinuous span=1d
| eval time=now()
| streamstats count
| eval time=relative_time(time,"-".count."d@d")
| eval value=random() % 50 + 1
| bin span=7d time
| chart sum(value) as count by time
| rename time as _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Anyway, even if it is not &lt;CODE&gt;timechart&lt;/CODE&gt;, you can create a time series table.&lt;BR /&gt;
Isn't it ok to limit &lt;STRONG&gt;_time&lt;/STRONG&gt; with &lt;CODE&gt;where&lt;/CODE&gt;, create a table, and rename it?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 12:24:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486113#M136002</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-18T12:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486114#M136003</link>
      <description>&lt;P&gt;That seems pretty impossible because my answer is a slightly improved version of what you said in your other answer is already working.  The &lt;CODE&gt;addinfo&lt;/CODE&gt; part takes the timepicker's values and trims based on that instead of hard-coded.  Are you sure that you are using what I posted?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 14:08:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486114#M136003</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-18T14:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite _time with field only shows all entries in timechart ignoring the timeframe selected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486115#M136004</link>
      <description>&lt;P&gt;Yes, I copied and pasted it from here.&lt;/P&gt;

&lt;P&gt;I see now it needs to have the  "earliest=0 latest=now" removed for this to work.&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 16:57:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overwrite-time-with-field-only-shows-all-entries-in-timechart/m-p/486115#M136004</guid>
      <dc:creator>andimnf</dc:creator>
      <dc:date>2019-11-18T16:57:35Z</dc:date>
    </item>
  </channel>
</rss>

