<?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 How to visualize data using the time field from the raw data, as opposed to the Timestamp? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-data-using-the-time-field-from-the-raw-data-as/m-p/668368#M229289</link>
    <description>&lt;P&gt;Hello, I am a beginner with Splunk. I am experimenting with a csv dataset containing the daily average temperature for different cities across the world. As a first step, I would like to see, for a given city, the graph for the average temperature over time. However by default, the X axis on the timechart shows the timestamp of the source file, as opposed to the time field contained in each event. As a result, all events show the same date, which is probably the date the dataset was created.&lt;BR /&gt;&lt;BR /&gt;How do I use the "Date" field contained in each event, instead of the Timestamp of the dataset file?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Sun, 12 Nov 2023 20:33:39 GMT</pubDate>
    <dc:creator>phildefer</dc:creator>
    <dc:date>2023-11-12T20:33:39Z</dc:date>
    <item>
      <title>How to visualize data using the time field from the raw data, as opposed to the Timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-data-using-the-time-field-from-the-raw-data-as/m-p/668368#M229289</link>
      <description>&lt;P&gt;Hello, I am a beginner with Splunk. I am experimenting with a csv dataset containing the daily average temperature for different cities across the world. As a first step, I would like to see, for a given city, the graph for the average temperature over time. However by default, the X axis on the timechart shows the timestamp of the source file, as opposed to the time field contained in each event. As a result, all events show the same date, which is probably the date the dataset was created.&lt;BR /&gt;&lt;BR /&gt;How do I use the "Date" field contained in each event, instead of the Timestamp of the dataset file?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Sun, 12 Nov 2023 20:33:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-data-using-the-time-field-from-the-raw-data-as/m-p/668368#M229289</guid>
      <dc:creator>phildefer</dc:creator>
      <dc:date>2023-11-12T20:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to visualize data using the time field from the raw data, as opposed to the Timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-data-using-the-time-field-from-the-raw-data-as/m-p/668370#M229291</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/262409"&gt;@phildefer&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I would normally recommend extracting the timestamp correctly when the data is indexed, but if you've uploaded the csv file as a lookup file, your approach would differ.&lt;/P&gt;&lt;P&gt;How are you searching the data? How is the Date field formatted?&lt;/P&gt;</description>
      <pubDate>Sun, 12 Nov 2023 21:36:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-data-using-the-time-field-from-the-raw-data-as/m-p/668370#M229291</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2023-11-12T21:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to visualize data using the time field from the raw data, as opposed to the Timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-data-using-the-time-field-from-the-raw-data-as/m-p/668371#M229292</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49493"&gt;@tscroggins&lt;/a&gt;&amp;nbsp;says, it's always important to get your ingest dates correctly extracted from the data in the first place.&lt;/P&gt;&lt;P&gt;However, to extract a time from a field in the data you use the &lt;STRONG&gt;strptime&lt;/STRONG&gt;() function, e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval _time=strptime(date_field, "format_string")&lt;/LI-CODE&gt;&lt;P&gt;which will overwrite the existing _time field with the time converted from your data field called &lt;STRONG&gt;date_field&lt;/STRONG&gt;&amp;nbsp;according to the format string you specify.&lt;/P&gt;&lt;P&gt;Time format variables are documented here&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.1.1/SearchReference/Commontimeformatvariables" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.1.1/SearchReference/Commontimeformatvariables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;e, g. this example, which you can paste into your search bar will convert the string in my_date_field to _time.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval my_date_field="2023-11-13 08:01:02.123"
| eval _time=strptime(my_date_field, "%F %T.%Q")&lt;/LI-CODE&gt;&lt;P&gt;Note that times are converted to epoch times, but the _time field is special in that it will show you the formatted date, rather than the epoch.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Nov 2023 21:54:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-data-using-the-time-field-from-the-raw-data-as/m-p/668371#M229292</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-11-12T21:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to visualize data using the time field from the raw data, as opposed to the Timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-data-using-the-time-field-from-the-raw-data-as/m-p/668372#M229293</link>
      <description>&lt;P&gt;Date has YYYY-MM-DD format. I managed changing the '_time'&amp;nbsp; field by using&amp;nbsp; the command:&lt;BR /&gt;eval _time=strptime(Date,"%Y-%m-%d")&lt;BR /&gt;&lt;BR /&gt;Now the Time column in the events list shows the date in the dd/mm/yyyy, with the actual time of 00:00:00.000&lt;/P&gt;</description>
      <pubDate>Sun, 12 Nov 2023 21:54:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-data-using-the-time-field-from-the-raw-data-as/m-p/668372#M229293</guid>
      <dc:creator>phildefer</dc:creator>
      <dc:date>2023-11-12T21:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to visualize data using the time field from the raw data, as opposed to the Timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-data-using-the-time-field-from-the-raw-data-as/m-p/668373#M229294</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;noted, this is the way. The timestamp is time zone-aware, though, so be mindful of the offset. If you prefer, you can include a time zone in your conversion, e.g. as a shortcut for for UTC:&lt;/P&gt;&lt;P&gt;|&amp;nbsp;&lt;SPAN&gt;eval _time=strptime(Date."Z", "%Y-%m-%d%Z")&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Nov 2023 22:10:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-data-using-the-time-field-from-the-raw-data-as/m-p/668373#M229294</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2023-11-12T22:10:07Z</dc:date>
    </item>
  </channel>
</rss>

