<?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: Timespan trouble with timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timespan-trouble-with-timechart/m-p/41412#M9599</link>
    <description>&lt;P&gt;&lt;CODE&gt;date_year&lt;/CODE&gt;, and the other &lt;CODE&gt;date_*&lt;/CODE&gt; fields are extracted from &lt;CODE&gt;_raw&lt;/CODE&gt;, and will be present in almost all events that contain a recognizable timestamp. Usually, &lt;CODE&gt;_time&lt;/CODE&gt; will be the same, with adjustments for timezones if relevant. &lt;/P&gt;

&lt;P&gt;It seems that your replacement of &lt;CODE&gt;_time&lt;/CODE&gt; might not be working as you expected, and it's a bit hard to tell without knowing what your configurations and source data looks like.&lt;/P&gt;

&lt;P&gt;/K &lt;/P&gt;</description>
    <pubDate>Wed, 21 Aug 2013 10:51:14 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2013-08-21T10:51:14Z</dc:date>
    <item>
      <title>Timespan trouble with timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timespan-trouble-with-timechart/m-p/41411#M9598</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm having some issues with timechart.&lt;BR /&gt;
I'm overriding _time in props.conf, since my timestamp is extracted from source, and this part works fine. In some rare cases the source doesn't contain a timestamp, then I will set it to 1/1/2002 00.00.00.&lt;/P&gt;

&lt;P&gt;I run this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=my_sourcetype os_name=* | timechart count(os_name) by os_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and it looks correct. However, when I want to limit the timespan to this year only, the 2002-events will still show.&lt;BR /&gt;
I looked at the date_year field, and it's value is 2013 even in the 2002-events. I wanted to see if this field was the problem so I tried modifying my search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=my_sourcetype os_name=* | eval date_year=if(match(file_date,"2002.*"),2002,date_year) | timechart count(os_name) by os_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but it doesn't change my timechart, the 2002-events are still visible even though my chosen time doesn't include the year 2002.&lt;/P&gt;

&lt;P&gt;So, now I wonder what the problem might be?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2013 10:35:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timespan-trouble-with-timechart/m-p/41411#M9598</guid>
      <dc:creator>gelica</dc:creator>
      <dc:date>2013-08-21T10:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Timespan trouble with timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timespan-trouble-with-timechart/m-p/41412#M9599</link>
      <description>&lt;P&gt;&lt;CODE&gt;date_year&lt;/CODE&gt;, and the other &lt;CODE&gt;date_*&lt;/CODE&gt; fields are extracted from &lt;CODE&gt;_raw&lt;/CODE&gt;, and will be present in almost all events that contain a recognizable timestamp. Usually, &lt;CODE&gt;_time&lt;/CODE&gt; will be the same, with adjustments for timezones if relevant. &lt;/P&gt;

&lt;P&gt;It seems that your replacement of &lt;CODE&gt;_time&lt;/CODE&gt; might not be working as you expected, and it's a bit hard to tell without knowing what your configurations and source data looks like.&lt;/P&gt;

&lt;P&gt;/K &lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2013 10:51:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timespan-trouble-with-timechart/m-p/41412#M9599</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-08-21T10:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Timespan trouble with timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timespan-trouble-with-timechart/m-p/41413#M9600</link>
      <description>&lt;P&gt;This was to long for a comment:&lt;/P&gt;

&lt;P&gt;When I look at the timeline in splunk it seems like the _time-field is correct.&lt;BR /&gt;
I'm extracting a field called file_date from source, then I'm using eval in props.conf to override time(in some cases the timestamp doesn't contain a time):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-_time=case(match(file_date,"\d{4}(-\d{2}){2}_\d{2}(-\d{2}){2}"),strptime(file_date,"%F_%H-%M-%S"), match(file_date,"\d{4}(-\d{2}){2}"), strptime(file_date,"%F"))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is what I have in transforms.conf where I extract file_date(and I'm referring to this stanza with TRANSFORM in props.conf and I have modified the field.conf-file as well):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[file_date]
SOURCE_KEY=MetaData:Source
REGEX=.*\w*_(\d{4}(-\d{2}){2}(_\d{2}(-\d{2}){2})?)
FORMAT=file_date::$1
DEFAULT_VALUE=file_date::"2002-01-01_00-00-00"
WRITE_META=true
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Aug 2013 10:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timespan-trouble-with-timechart/m-p/41413#M9600</guid>
      <dc:creator>gelica</dc:creator>
      <dc:date>2013-08-21T10:57:04Z</dc:date>
    </item>
  </channel>
</rss>

