<?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 event timestamp from CSV in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/71169#M14481</link>
    <description>&lt;P&gt;There might not be anything wrong with what you are doing - remember that Splunk indexes the data just once. If you change &lt;CODE&gt;props.conf&lt;/CODE&gt;, it will not change existing data - only future data. To change existing data, you will need to remove it from the Splunk index and reindex it.&lt;/P&gt;

&lt;P&gt;But here is another way to do things. In my example below, I don't use &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD = 0&lt;/CODE&gt;. Also, there is no need to set the &lt;CODE&gt;CHECK_METHOD&lt;/CODE&gt;.  Finally, I assume that the number of fields (ie, commas) is &lt;EM&gt;always&lt;/EM&gt; the same.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/var/log/billing/462819316490-aws-billing-detailed-line-items-2*]
sourcetype = aws-billing-detailed
SHOULD_LINEMERGE = false
TIME_FORMAT = %Y-%m-%d %H:%M:%S

TIME_PREFIX=(?:.*?,){13}"
MAX_TIMESTAMP_LOOKAHEAD = 20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;BTW, I counted 13 commas.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Dec 2012 21:52:10 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2012-12-21T21:52:10Z</dc:date>
    <item>
      <title>Extracting event timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/71168#M14480</link>
      <description>&lt;P&gt;My apologies in advance for having to ask this question again but I did not get a definitive answer my first time.&lt;/P&gt;

&lt;P&gt;I am struggling to get timestamp extraction to work for CSV files.&lt;/P&gt;

&lt;P&gt;First, a bit about my setup. The CSV files are being processed by a Universal Forwarder and then the data is sent off to the indexer.&lt;/P&gt;

&lt;P&gt;Here is the header line and the first line of data from the csv source:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Estimated","462819316490","050506831222","LineItem","Amazon Elastic Compute Cloud","840814","855132","191235","BoxUsage","RunInstances","us-east-1a","N","$0.065 per M1 Standard Small (m1.small) Linux/UNIX instance-hour (or partial hour)","2012-12-01 00:00:00","2012-12-01 01:00:00","23.00000000","0.0650000000","1.49500000","0.0650000000","1.49500000"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On the universal forwarder, I set a custom sourcetype,the props.conf file&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/var/log/billing/462819316490-aws-billing-detailed-line-items-2*]
sourcetype = aws-billing-detailed
CHECK_METHOD = endpoint_md5
SHOULD_LINEMERGE = false
MAX_TIMESTAMP_LOOKAHEAD = 0
TIME_FORMAT = %Y-%m-%d %H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I&lt;BR /&gt;
The desired behavior would be that Splunk sets the timestamp to be the first of the two time columns in the csv data. (ie, "2012-12-01 00:00:00")&lt;/P&gt;

&lt;P&gt;The problem is that Splunk is still setting the timestamp to the file date.&lt;/P&gt;

&lt;P&gt;Any guidance would be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2012 19:00:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/71168#M14480</guid>
      <dc:creator>jcbrendsel</dc:creator>
      <dc:date>2012-12-21T19:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting event timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/71169#M14481</link>
      <description>&lt;P&gt;There might not be anything wrong with what you are doing - remember that Splunk indexes the data just once. If you change &lt;CODE&gt;props.conf&lt;/CODE&gt;, it will not change existing data - only future data. To change existing data, you will need to remove it from the Splunk index and reindex it.&lt;/P&gt;

&lt;P&gt;But here is another way to do things. In my example below, I don't use &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD = 0&lt;/CODE&gt;. Also, there is no need to set the &lt;CODE&gt;CHECK_METHOD&lt;/CODE&gt;.  Finally, I assume that the number of fields (ie, commas) is &lt;EM&gt;always&lt;/EM&gt; the same.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/var/log/billing/462819316490-aws-billing-detailed-line-items-2*]
sourcetype = aws-billing-detailed
SHOULD_LINEMERGE = false
TIME_FORMAT = %Y-%m-%d %H:%M:%S

TIME_PREFIX=(?:.*?,){13}"
MAX_TIMESTAMP_LOOKAHEAD = 20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;BTW, I counted 13 commas.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2012 21:52:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/71169#M14481</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-12-21T21:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting event timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/71170#M14482</link>
      <description>&lt;P&gt;Yes, I was aware that it splunk only indexes the file once. In my case, the billing file is downloaded in full each time it is updated so is completely reindexed if the md5 has changed.&lt;/P&gt;

&lt;P&gt;As for your other changes, they are merely different ways of stating the same thing and dont address the issue.  (Just to be sure, I did try them to no effect.&lt;/P&gt;

&lt;P&gt;Im still stumped.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Dec 2012 13:49:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/71170#M14482</guid>
      <dc:creator>jcbrendsel</dc:creator>
      <dc:date>2012-12-23T13:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting event timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/71171#M14483</link>
      <description>&lt;P&gt;Hello JCBrendsel,&lt;/P&gt;

&lt;P&gt;I'm trying to add a CSV file to splunk and I'm also getting the same behaviour as you described above. Have you been able to solve it? How?&lt;/P&gt;

&lt;P&gt;Thanks, regards,&lt;BR /&gt;
Marcus&lt;/P&gt;</description>
      <pubDate>Sun, 11 Dec 2016 23:03:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/71171#M14483</guid>
      <dc:creator>mvdcouto</dc:creator>
      <dc:date>2016-12-11T23:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting event timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/540040#M90428</link>
      <description>&lt;P&gt;In my case I'm eliminating header using transforms.conf before it indexing . So still can I able to capture timestamp from the csv file from each row. your answers could help me a lot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Props.conf&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;TRANSFORMS-eliminate_header = eliminate_header&lt;BR /&gt;INDEXED_EXTRACTIONS = CSV&lt;BR /&gt;FIELD_DELIMITER = ,&lt;BR /&gt;TZ=UTC&lt;BR /&gt;TIMESTAMP_FIELDS = Date,Time&lt;BR /&gt;HEADER_FIELD_LINE_NUMBER = 1&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Transforoms.conf&lt;/STRONG&gt;&lt;BR /&gt;[eliminate_header]&lt;BR /&gt;REGEX = "Date"|"Time"|"Action"|"Category Name"|"Localized Country"|"Policy Name"|"User"|"Workstation"|"Domain"|"Protocol"|"Query"&lt;BR /&gt;DEST_KEY = queue&lt;BR /&gt;FORMAT = nullQueue&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 04:03:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/540040#M90428</guid>
      <dc:creator>rajasha</dc:creator>
      <dc:date>2021-02-16T04:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting event timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/540041#M90429</link>
      <description>&lt;P&gt;In my case I'm eliminating header using transforms.conf before it indexing . So still can I able to capture timestamp from the csv file from each row. your answers could help me a lot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Props.conf&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;TRANSFORMS-eliminate_header = eliminate_header&lt;BR /&gt;INDEXED_EXTRACTIONS = CSV&lt;BR /&gt;FIELD_DELIMITER = ,&lt;BR /&gt;TZ=UTC&lt;BR /&gt;TIMESTAMP_FIELDS = Date,Time&lt;BR /&gt;HEADER_FIELD_LINE_NUMBER = 1&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Transforoms.conf&lt;/STRONG&gt;&lt;BR /&gt;[eliminate_header]&lt;BR /&gt;REGEX = "Date"|"Time"|"Action"|"Category Name"|"Localized Country"|"Policy Name"|"User"|"Workstation"|"Domain"|"Protocol"|"Query"&lt;BR /&gt;DEST_KEY = queue&lt;BR /&gt;FORMAT = nullQueue&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 04:55:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-timestamp-from-CSV/m-p/540041#M90429</guid>
      <dc:creator>rajasha</dc:creator>
      <dc:date>2021-02-16T04:55:33Z</dc:date>
    </item>
  </channel>
</rss>

