<?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: Timestamp issue, nanoseconds needed for correct ordering in Log Analytics</title>
    <link>https://community.dynatrace.com/t5/Log-Analytics/Timestamp-issue-nanoseconds-needed-for-correct-log-ordering/m-p/289756#M1484</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/21992"&gt;@pditmar2&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;In our internal resources, I've found a workaround, that could potentially solve your use case. Let us know if this helps:&lt;/P&gt;
&lt;DIV class="p-rich_text_section"&gt;&lt;EM&gt;It looks like the issue may be related to how microseconds are being parsed and stored in Grail. By default, sorting on the&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;timestamp&lt;/CODE&gt;&amp;nbsp;field only goes down to the millisecond level, which can cause logs with identical timestamps to appear out of the expected order. As a workaround, you can enhance your sort logic by adding the&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;ordinal&lt;/CODE&gt;&amp;nbsp;field alongside&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;timestamp&lt;/CODE&gt;. The&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;ordinal&lt;/CODE&gt;&amp;nbsp;reflects the order in which logs were ingested into Grail, which typically aligns with how they were emitted by the application. Here’s an updated query you can use:&lt;/EM&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="p-rich_text_block--no-overflow"&gt;&lt;LI-CODE lang="markup"&gt;fetch logs
| filter matchesValue(status, { "INFO", "WARN", "ERROR" }) AND matchesValue(k8s.namespace.name, "namespace-name")
| sort timestamp, ordinal desc&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Nov 2025 14:10:03 GMT</pubDate>
    <dc:creator>MaciejNeumann</dc:creator>
    <dc:date>2025-11-18T14:10:03Z</dc:date>
    <item>
      <title>Timestamp issue - nanoseconds needed for correct log ordering</title>
      <link>https://community.dynatrace.com/t5/Log-Analytics/Timestamp-issue-nanoseconds-needed-for-correct-log-ordering/m-p/275126#M1274</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an issue with the timestamp of ingested logs. Dynatrace cuts out the nanoseconds, which in some cases make two events appear to be in the wrong order. This messes up my Business Flows. The actual timestamp that I would like to use, including nanoseconds, is available in the logs. At the arrow, you can see the record that is in the wrong order. In the screenshots you can see the "started" is listed after the "finished" because the nanoseconds get cut off.&lt;/P&gt;
&lt;P&gt;Is there any way I can add the nanoseconds to the timestamp that is used by Dynatrace for ordering the logs (and for the business events).&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bizeventerror.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27923i7FA5529EBD078946/image-size/large?v=v2&amp;amp;px=999" role="button" title="bizeventerror.jpg" alt="bizeventerror.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timestampnano.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27924i4D94E3ADB624316E/image-size/large?v=v2&amp;amp;px=999" role="button" title="timestampnano.jpg" alt="timestampnano.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 13:39:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Log-Analytics/Timestamp-issue-nanoseconds-needed-for-correct-log-ordering/m-p/275126#M1274</guid>
      <dc:creator>pditmar2</dc:creator>
      <dc:date>2025-12-17T13:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp issue, nanoseconds needed for correct ordering</title>
      <link>https://community.dynatrace.com/t5/Log-Analytics/Timestamp-issue-nanoseconds-needed-for-correct-log-ordering/m-p/289756#M1484</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/21992"&gt;@pditmar2&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;In our internal resources, I've found a workaround, that could potentially solve your use case. Let us know if this helps:&lt;/P&gt;
&lt;DIV class="p-rich_text_section"&gt;&lt;EM&gt;It looks like the issue may be related to how microseconds are being parsed and stored in Grail. By default, sorting on the&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;timestamp&lt;/CODE&gt;&amp;nbsp;field only goes down to the millisecond level, which can cause logs with identical timestamps to appear out of the expected order. As a workaround, you can enhance your sort logic by adding the&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;ordinal&lt;/CODE&gt;&amp;nbsp;field alongside&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;timestamp&lt;/CODE&gt;. The&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;ordinal&lt;/CODE&gt;&amp;nbsp;reflects the order in which logs were ingested into Grail, which typically aligns with how they were emitted by the application. Here’s an updated query you can use:&lt;/EM&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="p-rich_text_block--no-overflow"&gt;&lt;LI-CODE lang="markup"&gt;fetch logs
| filter matchesValue(status, { "INFO", "WARN", "ERROR" }) AND matchesValue(k8s.namespace.name, "namespace-name")
| sort timestamp, ordinal desc&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 14:10:03 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Log-Analytics/Timestamp-issue-nanoseconds-needed-for-correct-log-ordering/m-p/289756#M1484</guid>
      <dc:creator>MaciejNeumann</dc:creator>
      <dc:date>2025-11-18T14:10:03Z</dc:date>
    </item>
  </channel>
</rss>

