<?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: Subsecond not getting parsed by Splunk in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224031#M43861</link>
    <description>&lt;P&gt;Since there is an underscore present between milliseconds and microseconds, and strptime can parse using single time format variable  %N, it will not be able to parse beyond underscore even with %6N, hence will skip microseconds.&lt;/P&gt;

&lt;P&gt;Would there be any possibility of change of logging event timestamp from 2016-10-29 13:24:43.310_394 to 2016-10-29 13:24:43.310394?&lt;/P&gt;

&lt;P&gt;If that is done then your existing pros.conf should work.&lt;BR /&gt;
TIME_FORMAT=%Y-%m-%d %H:%M:%S.%6N&lt;/P&gt;</description>
    <pubDate>Sun, 13 Nov 2016 09:42:37 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2016-11-13T09:42:37Z</dc:date>
    <item>
      <title>Subsecond not getting parsed by Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224029#M43859</link>
      <description>&lt;P&gt;I have log events in the following format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; 2016-10-29 13:24:43.310_394 [145-xxxxxxxxxxxxxxxxxx:49] [XXXX_XXXX_MASTER] (DEBUG) Mapping Instrument Code Type
 2016-10-29 13:24:43.310_805 [145-xxxxxxxxxxxxxxxxxx:49] [EnrichmentManager] (INFO) &amp;amp;CC_CURRENCY.process(): table lookup failed - no enrichment performed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where '_394' and '_805' are the microsecond values.&lt;/P&gt;

&lt;P&gt;So to parse the input, I've configured my props.conf as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[efx_gfixappia_ulbridgelog_pfseq]
SEDCMD-timefix=s/_//
TIME_PREFIX=^
TIME_FORMAT=%Y-%m-%d %H:%M:%S.%6N
SHOULD_LINEMERGE = false
TZ_ALIAS = HKT=GMT+08:00
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now when I try sorting the events accoring to _time, it gets sorted by the millisecond but the events remain unsorted beyond that. On trying to striptime the microsecond value, it gets displayed as 13:24:43.310000.&lt;/P&gt;

&lt;P&gt;I tried removing the sed command in props.conf, and removed the underscores in the logfile itself (in case the timestamp was being extracted before sed), to no avail.&lt;/P&gt;

&lt;P&gt;Any suggestions on what I need to fix/should look at to fix this issue?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224029#M43859</guid>
      <dc:creator>doberoi96</dc:creator>
      <dc:date>2020-09-29T11:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Subsecond not getting parsed by Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224030#M43860</link>
      <description>&lt;P&gt;Unless someone else has something better on how you can index it out, can you try to search it out like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query to return the events
| rex "^(?&amp;lt;dateTimeString&amp;gt;[^_]+)_(?&amp;lt;microsecond&amp;gt;[\S]+)"
| eval epoch1=strptime( dateTimeString, "%Y-%m-%d %H:%M:%S.%6N")
| eval newTime=epoch1+(microsecond/1000000)
| fieldformat newTime=strftime(newTime, "%Y-%m-%d %H:%M:%S.%6N")
| table _time, newTime | sort newTime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 12 Nov 2016 07:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224030#M43860</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-12T07:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Subsecond not getting parsed by Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224031#M43861</link>
      <description>&lt;P&gt;Since there is an underscore present between milliseconds and microseconds, and strptime can parse using single time format variable  %N, it will not be able to parse beyond underscore even with %6N, hence will skip microseconds.&lt;/P&gt;

&lt;P&gt;Would there be any possibility of change of logging event timestamp from 2016-10-29 13:24:43.310_394 to 2016-10-29 13:24:43.310394?&lt;/P&gt;

&lt;P&gt;If that is done then your existing pros.conf should work.&lt;BR /&gt;
TIME_FORMAT=%Y-%m-%d %H:%M:%S.%6N&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2016 09:42:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224031#M43861</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2016-11-13T09:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Subsecond not getting parsed by Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224032#M43862</link>
      <description>&lt;P&gt;The timestamp parsing happens before the SEDCMD attribute is executed, hence it has no impact. Your option would to pre-process the log file (before Splunk reads it) to remove underscore, OR (kind of workaround which is not exactly you want but may be acceptable) use only the first 3 digits as millisecond. (set &lt;CODE&gt;TIME_FORMAT=%Y-%m-%d %H:%M:%S.%3N&lt;/CODE&gt;  and add &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD=23&lt;/CODE&gt; to your props.conf).&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2016 22:54:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224032#M43862</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-11-13T22:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Subsecond not getting parsed by Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224033#M43863</link>
      <description>&lt;P&gt;Unfortunately, that wouldn't work. I'm just modifying my search query instead of the indexed data.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 06:21:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224033#M43863</guid>
      <dc:creator>doberoi96</dc:creator>
      <dc:date>2016-11-14T06:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Subsecond not getting parsed by Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224034#M43864</link>
      <description>&lt;P&gt;Minor follow up: it works in a normal search, but how should I use this query in a dashboard XML file? I'm getting an &lt;CODE&gt;XML Syntax Error: Opening and ending tag mismatch: microsecond line 9 and query, line 9, column 346&lt;/CODE&gt;. The rest of the config is fine, it only runs into the error at microsecond.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 08:04:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224034#M43864</guid>
      <dc:creator>doberoi96</dc:creator>
      <dc:date>2016-11-14T08:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Subsecond not getting parsed by Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224035#M43865</link>
      <description>&lt;P&gt;From the error it looks like your xml code is taking &lt;CODE&gt;&amp;lt;microsecond&amp;gt;&lt;/CODE&gt; as an xml tag and trying to find its ending tag. Can you check if:&lt;/P&gt;

&lt;P&gt;1) you are missing the &lt;CODE&gt;"&lt;/CODE&gt; at the end of this line &lt;CODE&gt;| rex "^(?&amp;lt;dateTimeString&amp;gt;[^_]+)_(?&amp;lt;microsecond&amp;gt;[\S]+)"&lt;/CODE&gt;&lt;BR /&gt;
2) If microsecond is already a tag for you thereby renaming it to something else say &lt;CODE&gt;microsecond1&lt;/CODE&gt; in &lt;CODE&gt;| rex "^(?&amp;lt;dateTimeString&amp;gt;[^_]+)_(?&amp;lt;microsecond1&amp;gt;[\S]+)"&lt;/CODE&gt; and then using this in later &lt;CODE&gt;| eval newTime=epoch1+(microsecond1/1000000)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 01:54:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224035#M43865</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-15T01:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Subsecond not getting parsed by Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224036#M43866</link>
      <description>&lt;P&gt;Yep, you pointed in the correct direction. Using the &lt;CODE&gt;&amp;lt;![CDATA]]&lt;/CODE&gt; tag around the search query works. Thanks for the help! &lt;BR /&gt;
For your ref: &lt;A href="https://answers.splunk.com/answers/3435/escape-and-in-the-xml-of-dashboards.html"&gt;https://answers.splunk.com/answers/3435/escape-and-in-the-xml-of-dashboards.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 03:21:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224036#M43866</guid>
      <dc:creator>doberoi96</dc:creator>
      <dc:date>2016-11-15T03:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Subsecond not getting parsed by Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224037#M43867</link>
      <description>&lt;P&gt;Please take a look into: &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/688698/why-are-milliseconds-not-being-parsed-in-cluster-e.html"&gt;https://answers.splunk.com/answers/688698/why-are-milliseconds-not-being-parsed-in-cluster-e.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 10:06:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Subsecond-not-getting-parsed-by-Splunk/m-p/224037#M43867</guid>
      <dc:creator>freedomson</dc:creator>
      <dc:date>2019-02-05T10:06:26Z</dc:date>
    </item>
  </channel>
</rss>

