<?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 ISO8601 timestamp in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470824#M80930</link>
    <description>&lt;P&gt;I test your sample log.&lt;BR /&gt;
my &lt;EM&gt;props.conf&lt;/EM&gt; does not have time related settings.&lt;BR /&gt;
but time is extracted property.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [this:adminevents]
 SHOULD_LINEMERGE = false
 CHECK_FOR_HEADER = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At _time, from -05:00 to +09:00.  from local time to local time.&lt;BR /&gt;
That is enough, maybe.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="my props_conf extracts"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8391iEF93C71027601D6E/image-size/large?v=v2&amp;amp;px=999" role="button" title="my props_conf extracts" alt="my props_conf extracts" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2020 14:03:43 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-02-12T14:03:43Z</dc:date>
    <item>
      <title>Extracting ISO8601 timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470822#M80928</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I’m working on a powershell inputs and am stuck in regards to extracting the timestamp.&lt;/P&gt;

&lt;P&gt;An event is stdout from my script as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2020-02-05T14:11:36.000000-05:00 actinguser_userid="WJ" affecteduser_userid="DG" affecteduser_name="G,D" actiondescription="Password reset by administrator. "
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am using the following props:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[this:adminevents]
SHOULD_LINEMERGE = false
CHECK_FOR_HEADER = false
#KV_MODE = auto
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%6N
#TIME_PREFIX = Timestamp\s*:\s
TZ = -05:00
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is it possible to extract the timezone directly by parsing the timestamp?&lt;/P&gt;

&lt;P&gt;This is my first run through of an extraction, so I apologize if it's simple.&lt;/P&gt;

&lt;P&gt;Also, how do I debug extraction?  Is there a way to enable debugging so that a specific sourcetype's extraction steps are logged to &lt;CODE&gt;_internal&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 02:34:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470822#M80928</guid>
      <dc:creator>mbrownoutside</dc:creator>
      <dc:date>2020-02-12T02:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting ISO8601 timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470823#M80929</link>
      <description>&lt;P&gt;hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/202000"&gt;@mbrownoutside&lt;/a&gt;, Your event has timezone (-05:00), Splunk will automatically extract and use it. TIME_FORMAT starts reading after the TIME_PREFIX. Here there is no TIME_PREFIX. Remove/comment TIME_FORMAT and TZ and check.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:10:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470823#M80929</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-09-30T04:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting ISO8601 timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470824#M80930</link>
      <description>&lt;P&gt;I test your sample log.&lt;BR /&gt;
my &lt;EM&gt;props.conf&lt;/EM&gt; does not have time related settings.&lt;BR /&gt;
but time is extracted property.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [this:adminevents]
 SHOULD_LINEMERGE = false
 CHECK_FOR_HEADER = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At _time, from -05:00 to +09:00.  from local time to local time.&lt;BR /&gt;
That is enough, maybe.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="my props_conf extracts"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8391iEF93C71027601D6E/image-size/large?v=v2&amp;amp;px=999" role="button" title="my props_conf extracts" alt="my props_conf extracts" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:03:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470824#M80930</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-12T14:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting ISO8601 timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470825#M80931</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT = %FT%T.%6N%:z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cf &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/Commontimeformatvariables"&gt;time format&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:03:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470825#M80931</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-12T14:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting ISO8601 timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470826#M80932</link>
      <description>&lt;P&gt;It appears that I am, in fact, not using ISO8601, but RFC3339.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://medium.com/easyread/understanding-about-rfc-3339-for-datetime-formatting-in-software-engineering-940aa5d5f68a"&gt;This page&lt;/A&gt; goes into the differences and similarities.  RFC 3339 is more strict, and has provisions for timezone.&lt;/P&gt;

&lt;P&gt;This brought me to &lt;A href="https://answers.splunk.com/answers/527376/splunk-cannot-parse-iso8601rfc3339-timestamp-eg-20.html"&gt;this answers post&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;I expect the answer to be and will test now:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;%Y-%m-%dT%H:%M:%S.%6N%z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But in the doc you linked, %z does not have a definition for &lt;CODE&gt;-05:00&lt;/CODE&gt;, but only &lt;CODE&gt;-0500&lt;/CODE&gt; or &lt;CODE&gt;-5:00&lt;/CODE&gt; or &lt;CODE&gt;-05:00:00&lt;/CODE&gt;.  I could explicitly use &lt;CODE&gt;%:::z:00&lt;/CODE&gt;, but I then believe splunk may not properly extract the timstamp.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:03:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470826#M80932</guid>
      <dc:creator>mbrownoutside</dc:creator>
      <dc:date>2020-02-12T14:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting ISO8601 timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470827#M80933</link>
      <description>&lt;P&gt;This does not work.  I want to state a few things here to be transparent.  This is a legacy OS, and I had to install an older version of Splunk.  I have pushed the new &lt;CODE&gt;datetime.xml&lt;/CODE&gt; to the client, stating "Version 4.0", therefore, unless there were changes in the strftime() support from the version I am on, I don't expect there to be challenges.&lt;/P&gt;

&lt;P&gt;Please note that I also used the &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; &lt;CODE&gt;%Y-%m-%dT%H:%M:%S.%6N-05:00&lt;/CODE&gt; without luck.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:03:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470827#M80933</guid>
      <dc:creator>mbrownoutside</dc:creator>
      <dc:date>2020-02-12T14:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting ISO8601 timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470828#M80934</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="2020-02-05T14:11:36.000000-05:00 actinguser_userid=\"WJ\" affecteduser_userid=\"DG\" affecteduser_name=\"G,D\" actiondescription=\"Password reset by administrator. \""
| rex "(?&amp;lt;time&amp;gt;\S+)"
| eval _time=strptime(time,"%FT%T.%6N%:z")
| eval time2=strftime(_time,"%FT%T.%6N%:z")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;@mbrownoutside no problem.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:03:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470828#M80934</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-12T14:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting ISO8601 timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470829#M80935</link>
      <description>&lt;P&gt;Thank you for providing a test.  This works for any existing records at search time (of course).&lt;/P&gt;

&lt;P&gt;I am performing extraction in props.conf within the TA on the local UF.  That strptime() string does not work currently within the props.conf as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[this:adminevents]
SHOULD_LINEMERGE = false
CHECK_FOR_HEADER = false
TIME_FORMAT = %FT%T.%6N%:z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is it safe to assume that I also need to place this on my HF (or indexers)?  I was expecting that props.conf operates on the UF to perform timestamp extraction?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:03:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470829#M80935</guid>
      <dc:creator>mbrownoutside</dc:creator>
      <dc:date>2020-02-12T14:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting ISO8601 timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470830#M80936</link>
      <description>&lt;P&gt;I'm not sure where you're replies are, but I am seeing them via email notifications.&lt;/P&gt;

&lt;P&gt;I have tested with the following props.conf on the UF only:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[this:adminevents]
SHOULD_LINEMERGE = false
CHECK_FOR_HEADER = false
#KV_MODE = auto
#TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%6N-05:00
#TIME_FORMAT = %FT%T.%6N%:z
#TIME_PREFIX = Timestamp\s*:\s
#TZ = -05:00
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The _time is not extracted.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:30:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-ISO8601-timestamp/m-p/470830#M80936</guid>
      <dc:creator>mbrownoutside</dc:creator>
      <dc:date>2020-02-12T14:30:06Z</dc:date>
    </item>
  </channel>
</rss>

