# Display count of log content with content message and time

**URL:** <https://community.dynatrace.com/t/display-count-of-log-content-with-content-message-and-time/51558>\
**Category:** Logs\
**Tags:** dql, logs\
**Created:** [May 9, 2025, 2:19pm UTC](https://community.dynatrace.com/t/display-count-of-log-content-with-content-message-and-time/51558 "2025-05-09T14:19:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shal](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Shal](https://community.dynatrace.com/u/Shal)\
**Post date:** [May 9, 2025, 2:19pm UTC](https://community.dynatrace.com/t/display-count-of-log-content-with-content-message-and-time/51558/1 "2025-05-09T14:19:56Z")

</div>

Hi Team,

Can I get a query (DQL) that can display the results in the below manner for a particular log file

example: D:/logs/log.txt

I need different content and its count based on date or time selection.

| **content** | **count** | **date/time** |
| --- | --- | --- |
| error: abc | 2 | 5th may |
| error:def | 3 | 5th may |
| error: ghi | 1 | 6th may |

Thanks!

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [May 12, 2025, 12:46am UTC](https://community.dynatrace.com/t/display-count-of-log-content-with-content-message-and-time/51558/2 "2025-05-12T00:46:38Z")

</div>

[@Shal](https://community.dynatrace.com/user/89198)&nbsp;Here is an example query you can try

```markup
fetch logs
| fieldsAdd day = getDayOfMonth(timestamp), month = getMonth(timestamp)
| filter log.source == "D:/logs/logs.txt"
| summarize count = count(), by: { day, month, content }

```

---

<div class="post-metadata">

**Author:** ![Shal](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Shal](https://community.dynatrace.com/u/Shal)\
**Post date:** [May 12, 2025, 6:30am UTC](https://community.dynatrace.com/t/display-count-of-log-content-with-content-message-and-time/51558/3 "2025-05-12T06:30:08Z")

</div>

Hi&nbsp;[@p\_devulapalli](https://community.dynatrace.com/user/21657)

Thanks for the input.

Its showing the content, count ,day and month.

If you see the below snip, the red ones are same content and blue ones are same content. So can we sum it for a day so that it will show 2 contents with count as 4 each in this case.

Here it is showing separate count as there is small difference in microsecond

Thanks

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [May 12, 2025, 6:59am UTC](https://community.dynatrace.com/t/display-count-of-log-content-with-content-message-and-time/51558/4 "2025-05-12T06:59:03Z")

</div>

[@Shal](https://community.dynatrace.com/user/89198)&nbsp;that’s because of the timestamp in the content, you just need to find a way to clean/split up the content and them summarize to get the expected result
