# How to identify the list of servers exhibiting a specific high-volume logging behaviour?

**URL:** <https://community.dynatrace.com/t/how-to-identify-the-list-of-servers-exhibiting-a-specific-high-volume-logging-behaviour/49527>\
**Category:** Logs\
**Tags:** aggregations, logs\
**Created:** [December 31, 2024, 2:01pm UTC](https://community.dynatrace.com/t/how-to-identify-the-list-of-servers-exhibiting-a-specific-high-volume-logging-behaviour/49527 "2024-12-31T14:01:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron\_L](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@Aaron\_L](https://community.dynatrace.com/u/Aaron_L)\
**Post date:** [December 31, 2024, 2:01pm UTC](https://community.dynatrace.com/t/how-to-identify-the-list-of-servers-exhibiting-a-specific-high-volume-logging-behaviour/49527/1 "2024-12-31T14:01:47Z")

</div>

We are seeing that on a subset of our servers, a specific process is generating a very large number of log records containing a specific keyword “bypass”.

How would I produce a list/chart of only the servers that have reported an average of more than 1000 lines/hour containing this keyword, and the total # of log lines with the keyword, over the past 5 days?

Thanks,

Aaron

---

<div class="post-metadata">

**Author:** ![PedroSantos](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pedrosantos/32/28150_2.png) [@PedroSantos](https://community.dynatrace.com/u/PedroSantos)\
**Post date:** [December 31, 2024, 3:20pm UTC](https://community.dynatrace.com/t/how-to-identify-the-list-of-servers-exhibiting-a-specific-high-volume-logging-behaviour/49527/2 "2024-12-31T15:20:29Z")

</div>

Hey [@Aaron\_L](https://community.dynatrace.com/user/84888) ,

A quick way that might help you achieve your objective is setting up a notebook and running this DQL query:

```markup
fetch logs
| filter matchesPhrase(content, "bypass")
| summarize count(), by:{Host = dt.entity.host}
| sort `count()` desc

```

This will fetch all logs, find the ones with “bypass” in content, and display the number of logs per host sorted by desc.

It will provide a table similar to this:

 ![PedroSantos_0-1735657949970.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/48103cdcb6964caeca10abb84632937b9c0215e2.png)

(this one is from the demo live environment)

Note that this does not provide an average of lines/hr, but the total count of lines with “bypass” per host within your selected timeframe. Naturally, the Hosts with more lines per hour will still very likely rank higher on the list of total count.&nbsp; So this can still be used to identify the list of servers exhibiting this specific high-volume logging behavior.

And keep in mind that, on Notebooks, you can always make use of the timeframe selector to adjust to your needs and specific hours:

![PedroSantos_1-1735658101805.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/e/3e4f11ade66ed57215f3358d5659f59c3ac2f5da.png)

(I used last 2 hours)

Lastly, if you’re planning on having a dashboard with this query it might be worth to look into bucket assignment and optimize the query to look into specific buckets.

Let me know if this helps you 🙂

---

<div class="post-metadata">

**Author:** ![Aaron\_L](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@Aaron\_L](https://community.dynatrace.com/u/Aaron_L)\
**Post date:** [January 2, 2025, 10:17pm UTC](https://community.dynatrace.com/t/how-to-identify-the-list-of-servers-exhibiting-a-specific-high-volume-logging-behaviour/49527/3 "2025-01-02T22:17:09Z")

</div>

Hi&nbsp;[@PedroSantos](https://community.dynatrace.com/user/77112)&nbsp;,

Thanks for your suggestion.&nbsp; I’ve updated the query a bit, as I want to calculate the percentage of log lines containing the specific keyword that come from one executable.&nbsp; Unfortunately, the new column I’m adding with fieldsAdd does not appear to function as I expect - I always get a 0 in the column.  
Here is my current query:

```markup
fetch logs
| filter contains(content, "bypass")
| summarize TotalLogLines = count(), MyAppLogLines = countif(dt.process.name == "MyApp.exe"), by:{host.name}
| fieldsAdd MyAppPercent = round((MyAppLogLines/TotalLogLines)*100, decimals:2)

```

Any thoughts?

Thanks,  
Aaron

---

<div class="post-metadata">

**Author:** ![PedroSantos](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pedrosantos/32/28150_2.png) [@PedroSantos](https://community.dynatrace.com/u/PedroSantos)\
**Post date:** [January 3, 2025, 11:04am UTC](https://community.dynatrace.com/t/how-to-identify-the-list-of-servers-exhibiting-a-specific-high-volume-logging-behaviour/49527/4 "2025-01-03T11:04:22Z")

</div>

Hey [@Aaron\_L](https://community.dynatrace.com/user/84888) ,  
One thing to keep in mind is that in Dynatrace Query Language the division between two integer values is an integer, which gets rid of any decimal portion.  
Easy straightforward solution to this is just to cast both variabels to double:

```markup
fetch logs
| filter contains(content, "bypass")
| summarize TotalLogLines = count(), MyAppLogLines = countif(dt.process.name == "MyApp.exe"), by:{host.name}
| fieldsAdd MyAppPercent = round((toDouble(MyAppLogLines)/toDouble(TotalLogLines))*100, decimals:2)

```

A different less spaghetti code solution is also to just multiply one of the variables by 1.0, which makes the result not an integer.

```markup
fetch logs
| filter contains(content, "bypass")
| summarize TotalLogLines = count(), MyAppLogLines = countif(dt.process.name == "MyApp.exe"), by:{host.name}
| fieldsAdd MyAppPercent = round(( (1.0*MyAppLogLines)/TotalLogLines)*100, decimals:2)

```

See if either works for you 🙂

---

<div class="post-metadata">

**Author:** ![Aaron\_L](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@Aaron\_L](https://community.dynatrace.com/u/Aaron_L)\
**Post date:** [January 3, 2025, 7:24pm UTC](https://community.dynatrace.com/t/how-to-identify-the-list-of-servers-exhibiting-a-specific-high-volume-logging-behaviour/49527/5 "2025-01-03T19:24:57Z")

</div>

Hi&nbsp;[@PedroSantos](https://community.dynatrace.com/user/77112)&nbsp;,

Thanks for the quick response.&nbsp; The toDouble() option worked well, and like the \*1.0 option, it’s only required on one of the variables to convert the result to floating point.&nbsp; Problem solved!

As I get a bit more experience with DQL, I may come back to the original problem of calculating average lines/hr, but this will do for now.

Aaron
