<?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: _time field is missing for events in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/time-field-is-missing-for-events/m-p/668487#M112043</link>
    <description>&lt;P&gt;Although you cannot technically represent those dates pre 1970 as the internal _time field, you CAN use negative epoch times as strptime will work and correctly format the negative epochs as the correct time, but as you found, you cannot parse dates pre 1970, so you'd have to create your epochs through calculation.&lt;/P&gt;&lt;P&gt;Splunk is not great with non _time values on the X-axis of timecharts, but you can chart over a string, where the string could be YYYYMM and it will render it correctly, you just don't get the dates on the x-axis.&lt;/P&gt;&lt;P&gt;You can get the idea from this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=3000
| streamstats c
| eval _time=now() - (c * (86400 * 30)) 
| eval month=strftime(_time, "%Y-%m")
| eval r=random() % 100
| chart avg(r) as r over month&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 14 Nov 2023 00:57:43 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-11-14T00:57:43Z</dc:date>
    <item>
      <title>_time field is missing for events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/time-field-is-missing-for-events/m-p/668479#M112041</link>
      <description>&lt;P&gt;My dataset has historical monthly average temperature for years 1745 to 2013. Since my source is a csv file, I used the following so the that the &lt;EM&gt;_time&amp;nbsp;&lt;/EM&gt;field represents the&amp;nbsp;timestamp in each event :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;source="Global warming trends.zip:*" source="Global warming trends.zip:./GlobalLandTemperaturesByMajorCity.csv" Country=Canada City=Montreal dt=*-01-*  AverageTemperature="*"  
| eval _time=strptime(dt,"%Y-%m-%d")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, all the events dated 1970 and prior don't have their timestamp in the 'Time' column, as per the attached capture. I suspect this has do do with Epoch time, but how do I fix this so I can vizualize my entire data set in a line chart?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-13 174412.jpg" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28092i71DE469FEA8EAD28/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-11-13 174412.jpg" alt="Screenshot 2023-11-13 174412.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 22:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/time-field-is-missing-for-events/m-p/668479#M112041</guid>
      <dc:creator>phildefer</dc:creator>
      <dc:date>2023-11-13T22:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: _time field is missing for events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/time-field-is-missing-for-events/m-p/668480#M112042</link>
      <description>&lt;P&gt;Essentially, you can't represent dates prior to 1970 as a timestamp. However, you could convert your dates to an integer, e.g. 1752-09-03 becomes 17,530,903 (except that particular date didn't exist!), and 2023-11-13 becomes 20,231,113 etc.&lt;/P&gt;&lt;P&gt;Obviously, this doesn't work if you want to use times as well, and you shouldn't save these in _time as that might be treated as an epoch time i.e. seconds since 1970-01-01.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 23:03:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/time-field-is-missing-for-events/m-p/668480#M112042</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-11-13T23:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: _time field is missing for events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/time-field-is-missing-for-events/m-p/668487#M112043</link>
      <description>&lt;P&gt;Although you cannot technically represent those dates pre 1970 as the internal _time field, you CAN use negative epoch times as strptime will work and correctly format the negative epochs as the correct time, but as you found, you cannot parse dates pre 1970, so you'd have to create your epochs through calculation.&lt;/P&gt;&lt;P&gt;Splunk is not great with non _time values on the X-axis of timecharts, but you can chart over a string, where the string could be YYYYMM and it will render it correctly, you just don't get the dates on the x-axis.&lt;/P&gt;&lt;P&gt;You can get the idea from this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=3000
| streamstats c
| eval _time=now() - (c * (86400 * 30)) 
| eval month=strftime(_time, "%Y-%m")
| eval r=random() % 100
| chart avg(r) as r over month&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 14 Nov 2023 00:57:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/time-field-is-missing-for-events/m-p/668487#M112043</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-11-14T00:57:43Z</dc:date>
    </item>
  </channel>
</rss>

