<?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: How to match a timestamp field in a Log in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/How-to-match-a-timestamp-field-in-a-Log/m-p/233496#M503</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/69662"&gt;@dynaNoob&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you have try this :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fieldsAdd myHangDuration = duration(HangDuration, unit:"s")&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 05 Jan 2024 21:17:13 GMT</pubDate>
    <dc:creator>gbaudart</dc:creator>
    <dc:date>2024-01-05T21:17:13Z</dc:date>
    <item>
      <title>How to match a timestamp field in a Log</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-match-a-timestamp-field-in-a-Log/m-p/231265#M412</link>
      <description>&lt;P&gt;I am very new to DQL and I am trying to breakdown a time field in a log content&lt;/P&gt;
&lt;P&gt;Ex:&lt;/P&gt;
&lt;P&gt;content:&lt;/P&gt;
&lt;P&gt;WARN, Module 1 has a thread in hung state, Thread hang duration: 00:00:00:32 -&lt;/P&gt;
&lt;P&gt;WARN, Module 2 has a thread in hung state, Thread hang duration: 00:00:54:15 -&lt;/P&gt;
&lt;P&gt;WARN, Module 3 has a thread in hung state, Thread hang duration: 00:00:1:36 -&lt;/P&gt;
&lt;P&gt;I am trying to extract "Thread hang duration" into a time field and if it is over a certain threshold value alert it.&lt;/P&gt;
&lt;P&gt;Query used:&lt;/P&gt;
&lt;P&gt;fetch logs&lt;BR /&gt;| filter contains(content, "hang duration")&lt;BR /&gt;| parse content, "LD 'Thread hang duration:' LD:HangDuration SPACE '-'"&lt;BR /&gt;| fields content, HangDuration&lt;/P&gt;
&lt;P&gt;As you can see I have parsed it with LD which works but if I use any other data type, I get null. I have tried&lt;/P&gt;
&lt;P&gt;timestamp, duration while parsing as well as converting it from parsed string like below&lt;/P&gt;
&lt;P&gt;| fieldsAdd myHangDuration = toTimestamp(HangDuration)&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 08:32:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-match-a-timestamp-field-in-a-Log/m-p/231265#M412</guid>
      <dc:creator>dynaNoob</dc:creator>
      <dc:date>2023-12-11T08:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to match a timestamp field in a Log</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-match-a-timestamp-field-in-a-Log/m-p/233496#M503</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/69662"&gt;@dynaNoob&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you have try this :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fieldsAdd myHangDuration = duration(HangDuration, unit:"s")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 05 Jan 2024 21:17:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-match-a-timestamp-field-in-a-Log/m-p/233496#M503</guid>
      <dc:creator>gbaudart</dc:creator>
      <dc:date>2024-01-05T21:17:13Z</dc:date>
    </item>
  </channel>
</rss>

