<?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: Extracting Timestamp From csv in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72474#M14787</link>
    <description>&lt;P&gt;You should be able to do this with a few index-time properties.  TIME_PREFIX tells Splunk where to start looking for a time match, and TIME_FORMAT tells Splunk what format to use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;## props.conf
[&amp;lt;your_sourcetype&amp;gt;]
TIME_PREFIX = ([^,]+),
TIME_FORMAT = %a %b %d %Y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Additional references if needed:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/Admin/Propsconf" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/Admin/Propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.python.org/library/time.html" rel="nofollow"&gt;http://docs.python.org/library/time.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2011 23:21:13 GMT</pubDate>
    <dc:creator>hazekamp</dc:creator>
    <dc:date>2011-03-31T23:21:13Z</dc:date>
    <item>
      <title>Extracting Timestamp From csv</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72472#M14785</link>
      <description>&lt;P&gt;Hello. I'm having an issue when indexing a csv file. The format of the data is like this.&lt;/P&gt;

&lt;P&gt;Employee,Date,Dept,Hours,Hour type,shift&lt;/P&gt;

&lt;P&gt;Chuck Norris,Sat Jan 01 2011,10,hourtype,shift&lt;/P&gt;

&lt;P&gt;etc&lt;/P&gt;

&lt;P&gt;When i upload the file, splunk extracts each row as an event and does proper field extraction, but, it timestamps all of those events with the upload time of the file, intead of assigning it a timestamp using the date column. I tried the solution in this link to no effect: &lt;A href="http://answers.splunk.com/questions/2672/defining-timestamp-on-data-from-csv-file" rel="nofollow"&gt;http://answers.splunk.com/questions/2672/defining-timestamp-on-data-from-csv-file&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The odd thing is that another csv that gets indexed in nearly the same format, gets timestamped correctly. &lt;EM&gt;This&lt;/EM&gt; csv is generated by a script. The only difference is that it has an additional column with a ticket number. Even after i tried modifying my csv with the same column, it still doesn't extract the timestamp correctly. &lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2011 23:00:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72472#M14785</guid>
      <dc:creator>RicoSuave</dc:creator>
      <dc:date>2011-03-31T23:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Timestamp From csv</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72473#M14786</link>
      <description>&lt;P&gt;Could you edit this post to include the configuration you are referring to in your props.conf? It would be helpful if we could see what you've attempted.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2011 23:09:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72473#M14786</guid>
      <dc:creator>jbsplunk</dc:creator>
      <dc:date>2011-03-31T23:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Timestamp From csv</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72474#M14787</link>
      <description>&lt;P&gt;You should be able to do this with a few index-time properties.  TIME_PREFIX tells Splunk where to start looking for a time match, and TIME_FORMAT tells Splunk what format to use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;## props.conf
[&amp;lt;your_sourcetype&amp;gt;]
TIME_PREFIX = ([^,]+),
TIME_FORMAT = %a %b %d %Y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Additional references if needed:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/Admin/Propsconf" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/Admin/Propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.python.org/library/time.html" rel="nofollow"&gt;http://docs.python.org/library/time.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2011 23:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72474#M14787</guid>
      <dc:creator>hazekamp</dc:creator>
      <dc:date>2011-03-31T23:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Timestamp From csv</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72475#M14788</link>
      <description>&lt;P&gt;I tried this and it did not work. Is there anything else you recommend?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2011 05:41:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72475#M14788</guid>
      <dc:creator>RicoSuave</dc:creator>
      <dc:date>2011-04-07T05:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Timestamp From csv</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72476#M14789</link>
      <description>&lt;P&gt;Joetron, I just indexed your sample log above with the TIME_PREFIX and TIME_FORMAT properties above and everything looks good.  What specifically didn't work?  Be sure to specify these properties on indexer or full forwarder.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:27:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72476#M14789</guid>
      <dc:creator>hazekamp</dc:creator>
      <dc:date>2020-09-28T09:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Timestamp From csv</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72477#M14790</link>
      <description>&lt;P&gt;So i have a csv with hundreds of lines in the same format i specified above, but the lines have different dates. When i index that csv, splunk doesn't extract the timestamp individually from the date column in the csv, instead it assigns all the events the same time. That time being when the file was indexed.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2011 02:08:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-Timestamp-From-csv/m-p/72477#M14790</guid>
      <dc:creator>RicoSuave</dc:creator>
      <dc:date>2011-04-14T02:08:16Z</dc:date>
    </item>
  </channel>
</rss>

