<?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: CSV multiple timestamp fallback in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/CSV-multiple-timestamp-fallback/m-p/436857#M76210</link>
    <description>&lt;P&gt;so by that logic a transforms that detects presence and deletes 0001-01-01T00:00:00Z from the incoming line should work?&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2019 06:58:31 GMT</pubDate>
    <dc:creator>anthonysomerset</dc:creator>
    <dc:date>2019-05-02T06:58:31Z</dc:date>
    <item>
      <title>CSV multiple timestamp fallback</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/CSV-multiple-timestamp-fallback/m-p/436855#M76208</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have the following CSV format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cgrid,run_id,tor,origin_id,request_type,tenant,category,account,subject,destination,setup_time,answer_time,usage,cost
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;currently my props is set to use the answer_time field for timestamp extraction, but somes this is effectively empty - e.g.:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;6729deb0544ee7e070fc5435542a46f6f194c5a4,*default,*voice,24bc42be2202b3233669b06522bbff680gQAAC8WAAACBAAALxYAABfa2CKPkEHALB+DouyTTcix3zfVEmuvdz2ZCwFK/iDh0afBTmJ48N3K+SgnNIXs+ye+NV964OG1,*rated,zw.liquid.tel,call,2638677XXXXXX,2638677XXXXXX,263YYYYYYYYY,2019-05-02T05:59:53Z,0001-01-01T00:00:00Z,0,0.00000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;specifically 0001-01-01T00:00:00Z&lt;/P&gt;

&lt;P&gt;what i'd like to do is when this comes up, to use the setup_time field instead, i tried adding setup time as a second field in the props:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[CGRATES_RATED_CSV]
DATETIME_CONFIG =
FIELD_NAMES = cgrid,run_id,tor,origin_id,request_type,tenant,category,account,subject,destination,setup_time,answer_time,usage,cost
INDEXED_EXTRACTIONS = csv
KV_MODE = none
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TIMESTAMP_FIELDS = answer_time,setup_time
TZ = UTC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;however its not taking effect, the events are still taking answer_time and then generating as midnight on the same day, answer_time is my preferred timestamp, so i'd prefer to keep it and fall back to setup_time rather than always use setup_time&lt;/P&gt;

&lt;P&gt;is this possible and how would i do this?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:19:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/CSV-multiple-timestamp-fallback/m-p/436855#M76208</guid>
      <dc:creator>anthonysomerset</dc:creator>
      <dc:date>2020-09-30T00:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: CSV multiple timestamp fallback</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/CSV-multiple-timestamp-fallback/m-p/436856#M76209</link>
      <description>&lt;P&gt;Hi @anthonysomerset,&lt;/P&gt;

&lt;P&gt;As shown here, it's normal that in your case even when specifying both fields the timestamp will always be stuck on the first field (answer_time) :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIMESTAMP_FIELDS = [ &amp;lt;string&amp;gt;,..., &amp;lt;string&amp;gt;]
* Some CSV and structured files have their timestamp encompass multiple
  fields in the event separated by delimiters. This setting tells Splunk 
  software to specify all such fields which constitute the timestamp in a
  comma-separated fashion.
* If not specified, Splunk software tries to automatically extract the 
  timestamp of the event.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Admin/Propsconf"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/Admin/Propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This is because Splunk will try to stick the fields together to get a date, but your first field is already complete and therefore the date will not use any other field. Your best way to work around this is to make sure your answer_time field is empty instead of using "0001-01-01T00:00:00Z" as a filler.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 06:54:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/CSV-multiple-timestamp-fallback/m-p/436856#M76209</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-02T06:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: CSV multiple timestamp fallback</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/CSV-multiple-timestamp-fallback/m-p/436857#M76210</link>
      <description>&lt;P&gt;so by that logic a transforms that detects presence and deletes 0001-01-01T00:00:00Z from the incoming line should work?&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 06:58:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/CSV-multiple-timestamp-fallback/m-p/436857#M76210</guid>
      <dc:creator>anthonysomerset</dc:creator>
      <dc:date>2019-05-02T06:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: CSV multiple timestamp fallback</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/CSV-multiple-timestamp-fallback/m-p/436858#M76211</link>
      <description>&lt;P&gt;I was thinking more of getting rid of that line before even indexing, but yes transforms should do the trick as well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; let me know if it works out for u! Try it first by manually editing that 0001-01-01T00:00:00Z  out and then add the transforms.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 07:02:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/CSV-multiple-timestamp-fallback/m-p/436858#M76211</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-02T07:02:58Z</dc:date>
    </item>
  </channel>
</rss>

