<?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: Simple log parse in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Simple-log-parse/m-p/218957#M151</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/51897"&gt;@derija&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure if I fully understand your question. You can parse the the string with following pattern using &lt;A href="https://www.dynatrace.com/support/help/shortlink/dpl-pattern-expression-macros" target="_self"&gt;macros&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| parse content, """$threadCount = 'current thread count' LD;
DATA $threadCount:text"""&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;and the thread numbers can be parsed with following pattern&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| parse content, """DATA 'thread count = ' INT:thread1 '/' INT:thread2 LD 'thread pool size = ' INT:poolSize"""&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and here you have the full query&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| fetch logs
| filter dt.entity.host == "HOST-6C20F746C34E87C0"
| filter matchesPhrase(content, "current thread count")
| parse content, """$threadCount = 'current thread count' LD;
DATA $threadCount:text"""
| parse content, """DATA 'thread count = ' INT:thread1 '/' INT:thread2 LD 'thread pool size = ' INT:poolSize"""&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sinisa_zubic_0-1690352043862.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/13147iCCA55640A31A0384/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sinisa_zubic_0-1690352043862.png" alt="sinisa_zubic_0-1690352043862.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2023 06:14:14 GMT</pubDate>
    <dc:creator>sinisa_zubic</dc:creator>
    <dc:date>2023-07-26T06:14:14Z</dc:date>
    <item>
      <title>Simple log parse</title>
      <link>https://community.dynatrace.com/t5/DQL/Simple-log-parse/m-p/218953#M150</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Some of the parsing examples leave you not sure how to proceed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Data row in log file:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;20230725&lt;/SPAN&gt; &lt;SPAN class=""&gt;15&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt;24&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt;14&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;278&lt;/SPAN&gt; &lt;SPAN class=""&gt;[INFO]&lt;/SPAN&gt;&lt;SPAN&gt; DM.WAInputSessionRequestProcessor:&lt;/SPAN&gt;&lt;SPAN class=""&gt;7507&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;[2023-07-25_15:24:14.278]&lt;/SPAN&gt;&lt;SPAN&gt; Thread pool name = DM.InputProcessor creating new thread = DM.InputProcessor_312 current thread count = &lt;/SPAN&gt;&lt;SPAN class=""&gt;307&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN class=""&gt;380&lt;/SPAN&gt;&lt;SPAN&gt;/ max thread pool size = &lt;/SPAN&gt;&lt;SPAN class=""&gt;2000&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;I just want the string &lt;STRONG&gt;"current thread count = 307/380/ max thread pool size = 2000"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;I can find the log row:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;fetch logs&lt;BR /&gt;| filter matchesValue(dt.entity.host, "HOST-6C20F746C34E87C0")&lt;BR /&gt;| filter matchesPhrase(content, "current thread count")&lt;BR /&gt;| fieldsAdd fieldToParse = "current thread count"&lt;BR /&gt;| parse fieldToParse, "ld:text EOL"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But how do I just get the string specified above?&lt;/P&gt;
&lt;P&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 08:48:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Simple-log-parse/m-p/218953#M150</guid>
      <dc:creator>derija</dc:creator>
      <dc:date>2023-08-14T08:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Simple log parse</title>
      <link>https://community.dynatrace.com/t5/DQL/Simple-log-parse/m-p/218957#M151</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/51897"&gt;@derija&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure if I fully understand your question. You can parse the the string with following pattern using &lt;A href="https://www.dynatrace.com/support/help/shortlink/dpl-pattern-expression-macros" target="_self"&gt;macros&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| parse content, """$threadCount = 'current thread count' LD;
DATA $threadCount:text"""&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;and the thread numbers can be parsed with following pattern&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| parse content, """DATA 'thread count = ' INT:thread1 '/' INT:thread2 LD 'thread pool size = ' INT:poolSize"""&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and here you have the full query&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| fetch logs
| filter dt.entity.host == "HOST-6C20F746C34E87C0"
| filter matchesPhrase(content, "current thread count")
| parse content, """$threadCount = 'current thread count' LD;
DATA $threadCount:text"""
| parse content, """DATA 'thread count = ' INT:thread1 '/' INT:thread2 LD 'thread pool size = ' INT:poolSize"""&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sinisa_zubic_0-1690352043862.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/13147iCCA55640A31A0384/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sinisa_zubic_0-1690352043862.png" alt="sinisa_zubic_0-1690352043862.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 06:14:14 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Simple-log-parse/m-p/218957#M151</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-07-26T06:14:14Z</dc:date>
    </item>
  </channel>
</rss>

