<?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 do I keep date fields from doubling at ingestion? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-keep-date-fields-from-doubling-at-ingestion/m-p/502041#M85561</link>
    <description>&lt;P&gt;So I'm working on a project where i'm ingesting csv files.&lt;/P&gt;

&lt;P&gt;These file's time stamp can't be read until I pass the:&lt;/P&gt;

&lt;P&gt;Timestamp format = %Y-%m-%dT%H:%M:%S.%z&lt;BR /&gt;
Timestamp fields = time (which isn't in the csv, but shows up in the "Set Source Type" page of "Add Data" )&lt;/P&gt;

&lt;P&gt;Without it I get the errors: &lt;BR /&gt;
- Could not use strptime to parse timestamp from "2020 february tuesday 11 3 2 local 18 2020-02-18T11:03:02.000-0600".&lt;BR /&gt;
- Could not use regex to parse timestamp from "11 3 2 local 18 2020-02-18T1".&lt;/P&gt;

&lt;P&gt;my problem is that after ingestion i get double fields of every time related field.&lt;BR /&gt;
i.e.&lt;BR /&gt;
date_year = 2020&lt;BR /&gt;
date_year = 2020&lt;BR /&gt;
date_month = february&lt;BR /&gt;
date_month = february&lt;BR /&gt;
date_wday = tuesday&lt;BR /&gt;
date_wday = tuesday&lt;BR /&gt;
date_mday = 18&lt;BR /&gt;
date_mday = 18&lt;BR /&gt;
date_hour = 11&lt;BR /&gt;
date_hour = 11&lt;BR /&gt;
date_minute = 3&lt;BR /&gt;
date_minute = 3&lt;BR /&gt;
date_second = 6&lt;BR /&gt;
date_second = 6&lt;BR /&gt;
date_zone = local&lt;BR /&gt;
date_zone = local&lt;/P&gt;

&lt;P&gt;It still shows up in the fields sidebar as just single fields, but when I add them as an interesting field they double in the events page or when I list them using a table command.&lt;/P&gt;

&lt;P&gt;I've tried also setting Extraction to current time in "Set Source Type" page of "Add Data", but I still get double.&lt;/P&gt;

&lt;P&gt;*sample of when I table the date fields&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/287732-table-sample.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;*sample of what the field dates look like in events&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/287733-events.png" alt="alt text" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 04:44:32 GMT</pubDate>
    <dc:creator>Nanuk</dc:creator>
    <dc:date>2020-09-30T04:44:32Z</dc:date>
    <item>
      <title>How do I keep date fields from doubling at ingestion?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-keep-date-fields-from-doubling-at-ingestion/m-p/502041#M85561</link>
      <description>&lt;P&gt;So I'm working on a project where i'm ingesting csv files.&lt;/P&gt;

&lt;P&gt;These file's time stamp can't be read until I pass the:&lt;/P&gt;

&lt;P&gt;Timestamp format = %Y-%m-%dT%H:%M:%S.%z&lt;BR /&gt;
Timestamp fields = time (which isn't in the csv, but shows up in the "Set Source Type" page of "Add Data" )&lt;/P&gt;

&lt;P&gt;Without it I get the errors: &lt;BR /&gt;
- Could not use strptime to parse timestamp from "2020 february tuesday 11 3 2 local 18 2020-02-18T11:03:02.000-0600".&lt;BR /&gt;
- Could not use regex to parse timestamp from "11 3 2 local 18 2020-02-18T1".&lt;/P&gt;

&lt;P&gt;my problem is that after ingestion i get double fields of every time related field.&lt;BR /&gt;
i.e.&lt;BR /&gt;
date_year = 2020&lt;BR /&gt;
date_year = 2020&lt;BR /&gt;
date_month = february&lt;BR /&gt;
date_month = february&lt;BR /&gt;
date_wday = tuesday&lt;BR /&gt;
date_wday = tuesday&lt;BR /&gt;
date_mday = 18&lt;BR /&gt;
date_mday = 18&lt;BR /&gt;
date_hour = 11&lt;BR /&gt;
date_hour = 11&lt;BR /&gt;
date_minute = 3&lt;BR /&gt;
date_minute = 3&lt;BR /&gt;
date_second = 6&lt;BR /&gt;
date_second = 6&lt;BR /&gt;
date_zone = local&lt;BR /&gt;
date_zone = local&lt;/P&gt;

&lt;P&gt;It still shows up in the fields sidebar as just single fields, but when I add them as an interesting field they double in the events page or when I list them using a table command.&lt;/P&gt;

&lt;P&gt;I've tried also setting Extraction to current time in "Set Source Type" page of "Add Data", but I still get double.&lt;/P&gt;

&lt;P&gt;*sample of when I table the date fields&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/287732-table-sample.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;*sample of what the field dates look like in events&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/287733-events.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:44:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-keep-date-fields-from-doubling-at-ingestion/m-p/502041#M85561</guid>
      <dc:creator>Nanuk</dc:creator>
      <dc:date>2020-09-30T04:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep date fields from doubling at ingestion?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-keep-date-fields-from-doubling-at-ingestion/m-p/502042#M85562</link>
      <description>&lt;P&gt;I don't know what is causing this HOWEVER I do know that these fields are FAR less "interesting" than you think that they are.  These fields are for &lt;CODE&gt;DEBUGGING&lt;/CODE&gt; purposes; not for general use.  They are leftovers of the timesamping and timezoning process and are &lt;CODE&gt;PRE-NORMALIZED&lt;/CODE&gt; meaning that they are NOT for general use.  If you do not believe me then run this search and see for yourself:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* OR index=_* date_hour=*
| eval real = strftime(_time, "%A %B %d %T %Y %z")
| rex field=real "^(?&amp;lt;real_wday&amp;gt;\S+)\s+(?&amp;lt;real_month&amp;gt;\S+)\s+(?&amp;lt;real_mday&amp;gt;\S+)\s+(?&amp;lt;real_hour&amp;gt;\d+):(?&amp;lt;real_minute&amp;gt;\d+):(?&amp;lt;real_second&amp;gt;\d+)\s+(?&amp;lt;real_year&amp;gt;\S+)\s+(?&amp;lt;real_zone&amp;gt;\S+)"
| table real* date*
| foreach  real* date* [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = lower(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)]
| stats count count(eval(real_wday!=date_wday)) AS diff_wday count(eval(real_month!=date_month)) AS diff_month count(eval(real_mday!=date_mday)) AS diff_mday count(eval(real_hour!=date_hour)) AS diff_hour count(eval(real_minute!=date_minute)) AS diff_minute count(eval(real_second!=date_second)) AS diff_second count(eval(real_year!=date_year)) AS diff_year count(eval(real_zone!=date_zone)) AS diff_zone
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just think about it for a second.  If you have a different personal &lt;CODE&gt;Time zone&lt;/CODE&gt; setting than somebody else and you both run the same search for "yesterday", you are GUARANTEED to get different answers because the events brought back will be different AND because you are using &lt;CODE&gt;date_*&lt;/CODE&gt; fields that are pre-normalized.  NEVER use the &lt;CODE&gt;date_*&lt;/CODE&gt; fields; always calculate your own.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 15:48:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-keep-date-fields-from-doubling-at-ingestion/m-p/502042#M85562</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-29T15:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep date fields from doubling at ingestion?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-keep-date-fields-from-doubling-at-ingestion/m-p/502043#M85563</link>
      <description>&lt;P&gt;Figured it out.&lt;/P&gt;

&lt;P&gt;Seems I wasn't given a raw log file, but an extracted table of a sourcetype from and index. So it included the fields that Splunk generates on ingestion. Once I went through the log and deleted those fields it solved my problem.&lt;/P&gt;

&lt;P&gt;Thanks @woodcock for your take regarding this, it tipped me in the right direction.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 04:52:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-keep-date-fields-from-doubling-at-ingestion/m-p/502043#M85563</guid>
      <dc:creator>Nanuk</dc:creator>
      <dc:date>2020-03-31T04:52:09Z</dc:date>
    </item>
  </channel>
</rss>

