<?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: Added a new entry into datetime.xml and I can't seem to get it to work in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Added-a-new-entry-into-datetime-xml-and-I-can-t-seem-to-get-it/m-p/442320#M77076</link>
    <description>&lt;P&gt;make sure your &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; and &lt;CODE&gt;TIME_STAMPLOOKAHEAD&lt;/CODE&gt; are both set correctly in props.conf&lt;/P&gt;

&lt;P&gt;You custom_time should look like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;^&amp;lt;\d+&amp;gt;\d{4}-\d{2}-\d{2}T(\d{2}):(\d{2}):(\d{2}).\d{4}(\S\+?\-?\d{2}:\d{2})&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2019 18:40:12 GMT</pubDate>
    <dc:creator>chrisyounger</dc:creator>
    <dc:date>2019-02-01T18:40:12Z</dc:date>
    <item>
      <title>Added a new entry into datetime.xml and I can't seem to get it to work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Added-a-new-entry-into-datetime-xml-and-I-can-t-seem-to-get-it/m-p/442319#M77075</link>
      <description>&lt;P&gt;I need to add an additional time format for syslog data into the datetime.xml. &lt;BR /&gt;
Following the docs I have created a copy of datetime.xml and copied it to /system/local,&lt;BR /&gt;
added the following stanza to it:&lt;/P&gt;

&lt;P&gt;define name="custom_date" extract="year, month, day"&amp;gt;&lt;BR /&gt;
        &lt;TEXT&gt;&amp;lt;![CDATA[^&amp;lt;\d+&amp;gt;(\d{4})-(\d{2})-(\d{2})]]&amp;gt;&lt;/TEXT&gt;&lt;BR /&gt;
/define&amp;gt;&lt;BR /&gt;
define name="custom_time" extract="hour, minute, second, zone"&amp;gt;&lt;BR /&gt;
        &lt;TEXT&gt;&amp;lt;![CDATA[^&amp;lt;\d+&amp;gt;\d{4}-\d{2}-\d{2}T(\d{2}):(\d{2}):(\d{2}).\d{4}(\S\d{2}:\d{2})]]&amp;gt;&lt;/TEXT&gt;&lt;BR /&gt;
/define&amp;gt;&lt;/P&gt;

&lt;P&gt;timePatterns&amp;gt;&lt;BR /&gt;
      use name="custom_time"/&amp;gt;&lt;/P&gt;

&lt;P&gt;datePatterns&amp;gt;&lt;BR /&gt;
      use name="custom_date"/&amp;gt;&lt;/P&gt;

&lt;P&gt;I have also created a props.conf in system/local with the following stanza:&lt;BR /&gt;
[syslog]&lt;BR /&gt;
DATETIME_CONFIG = /etc/system/local/datetime.xml&lt;/P&gt;

&lt;P&gt;Below are example events that I am trying to get the extraction to work on:&lt;/P&gt;

&lt;P&gt;-86-2019-01-25T18:26:30.4563+04:00 This is a test event&lt;BR /&gt;
-86-2019-01-27T19:28:31.4563+00:00 This is a test event&lt;/P&gt;

&lt;P&gt;When I try to ingest a file (via the gui) with those events in the file and select syslog as sourcetype I get a warning saying that it could not use strptime to parse the timestamp.&lt;BR /&gt;
There is a highlight on the even that starts at the beginning of the line but ends at "+04:" , so for some reason it does not include the last two characters (00) in the timezone , even though the regex states that it should include it. &lt;/P&gt;

&lt;P&gt;Could someone help out?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:03:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Added-a-new-entry-into-datetime-xml-and-I-can-t-seem-to-get-it/m-p/442319#M77075</guid>
      <dc:creator>MedralaG</dc:creator>
      <dc:date>2020-09-29T23:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Added a new entry into datetime.xml and I can't seem to get it to work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Added-a-new-entry-into-datetime-xml-and-I-can-t-seem-to-get-it/m-p/442320#M77076</link>
      <description>&lt;P&gt;make sure your &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; and &lt;CODE&gt;TIME_STAMPLOOKAHEAD&lt;/CODE&gt; are both set correctly in props.conf&lt;/P&gt;

&lt;P&gt;You custom_time should look like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;^&amp;lt;\d+&amp;gt;\d{4}-\d{2}-\d{2}T(\d{2}):(\d{2}):(\d{2}).\d{4}(\S\+?\-?\d{2}:\d{2})&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 18:40:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Added-a-new-entry-into-datetime-xml-and-I-can-t-seem-to-get-it/m-p/442320#M77076</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-01T18:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Added a new entry into datetime.xml and I can't seem to get it to work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Added-a-new-entry-into-datetime-xml-and-I-can-t-seem-to-get-it/m-p/442321#M77077</link>
      <description>&lt;P&gt;OK, I eventually got to the bottom of this. &lt;BR /&gt;
The regex that I have put in there is fine , so is the remaining format of the xml file. &lt;BR /&gt;
I initially discovered that if I create a new sourcetype (and not use "syslog") and get it to use the datetime.xml then it works, so it must have been something in the syslog props definition.&lt;BR /&gt;
I eventually realised it was the MAX_TIMESTAMP_LOOKAHEAD which is set to 30 for syslog but for any new sourcetype (which will inherit the default settings) it will be set to 128.&lt;BR /&gt;
The timestamp in the log example that I have ends on the 43rd character of the event.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:09:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Added-a-new-entry-into-datetime-xml-and-I-can-t-seem-to-get-it/m-p/442321#M77077</guid>
      <dc:creator>MedralaG</dc:creator>
      <dc:date>2020-09-29T23:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Added a new entry into datetime.xml and I can't seem to get it to work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Added-a-new-entry-into-datetime-xml-and-I-can-t-seem-to-get-it/m-p/442322#M77078</link>
      <description>&lt;P&gt;Nice work!  Its extra confusing when the sourcetypes are changed during parsing or with a rename...&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 20:46:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Added-a-new-entry-into-datetime-xml-and-I-can-t-seem-to-get-it/m-p/442322#M77078</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-04T20:46:46Z</dc:date>
    </item>
  </channel>
</rss>

