# DQL+ DPL summarize

**URL:** <https://community.dynatrace.com/t/dql-dpl-summarize/46727>\
**Category:** DQL\
**Tags:** dql, notebooks, dpl, logs\
**Created:** [July 22, 2024, 11:53am UTC](https://community.dynatrace.com/t/dql-dpl-summarize/46727 "2024-07-22T11:53:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yann\_Buccellato](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yann\_Buccellato](https://community.dynatrace.com/u/Yann_Buccellato)\
**Post date:** [July 22, 2024, 11:53am UTC](https://community.dynatrace.com/t/dql-dpl-summarize/46727/1 "2024-07-22T11:53:00Z")

</div>

Good afternoon community,

I’m trying to summarize the count of some exception - everything it’s easy but some exception may vary based on some ID contained in the text. For example:

Inbound processing in endpoint at /IOM/\*\*\*\* failed with message “Fault:Sequential processing failed for number 0. Exchange[ID-56cdd22f-5910-4be0-5f99-2c2c-1721602311434-40-375098]. Caused by: [org.springframework.jms.ResourceAllocationException - Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded); nested exception is javax.jms.ResourceAllocationException: Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded)]”, caused by “JCSMPErrorResponseException:503: Max Transacted Sessions Exceeded”

Is there a way with a combination of DQL and DPL, or just one of the two to say “If field containing exception with: [ID-\*\*] then keep the everything as it is but just transform [ID-56cdd22f-5910-4be0-5f99-2c2c-1721602311434-40-375098] into [ID-\*]” ?

Regards

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [July 22, 2024, 5:37pm UTC](https://community.dynatrace.com/t/dql-dpl-summarize/46727/2 "2024-07-22T17:37:07Z")

</div>

Yes, it is possible with combination of couple of functions. I used example line and created 5 log lines out it with different IDs (2+2+1)

```markup
data record(content="""Fault:Sequential processing failed for number 0. Exchange[ID-56cdd22f-5910-4be0-5f99-2c2c-1721602311434-40-375098]. Caused by: [org.springframework.jms.ResourceAllocationException - Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded); nested exception is javax.jms.ResourceAllocationException: Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded)]", caused by "JCSMPErrorResponseException:503: Max Transacted Sessions Exceeded"""),
record(content="""Fault:Sequential processing failed for number 0. Exchange[ID-56cdd22f-5910-4be0-5f99-2c2c-1721602311434-40-375098]. Caused by: [org.springframework.jms.ResourceAllocationException - Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded); nested exception is javax.jms.ResourceAllocationException: Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded)]", caused by "JCSMPErrorResponseException:503: Max Transacted Sessions Exceeded"""),
record(content="""Fault:Sequential processing failed for number 0. Exchange[ID-99cdd22f-5910-4be0-5f99-2c2c-1721602311434-40-375098]. Caused by: [org.springframework.jms.ResourceAllocationException - Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded); nested exception is javax.jms.ResourceAllocationException: Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded)]", caused by "JCSMPErrorResponseException:503: Max Transacted Sessions Exceeded"""),
record(content="""Fault:Sequential processing failed for number 0. Exchange[ID-88cdd22f-5910-4be0-5f99-2c2c-1721602311434-40-375098]. Caused by: [org.springframework.jms.ResourceAllocationException - Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded); nested exception is javax.jms.ResourceAllocationException: Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded)]", caused by "JCSMPErrorResponseException:503: Max Transacted Sessions Exceeded"""),
record(content="""Fault:Sequential processing failed for number 0. Exchange[ID-88cdd22f-5910-4be0-5f99-2c2c-1721602311434-40-375098]. Caused by: [org.springframework.jms.ResourceAllocationException - Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded); nested exception is javax.jms.ResourceAllocationException: Error creating session - max transacted sessions exceeded (503: Max Transacted Sessions Exceeded)]", caused by "JCSMPErrorResponseException:503: Max Transacted Sessions Exceeded""")

| fieldsAdd content = if( matchesPhrase(content, "Exchange[ID-56cdd22f-5910-4be0-5f99-2c2c-1721602311434-40-375098]"), content, else: replacePattern(content, "'Exchange[ID' LD ']'", "Exchange[ID-*]" ) )
| summarize {cnt=count()}, by: {content}

```

If line contains given ID, I leave it without modifications. In other cases I use _ **replacePattern** _ function to modify content and remove not needed ID. After this operation when I summarize by content I just get 2 groups

 ![krzysztof_hoja_0-1721669606993.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/f/3f2f5c51fd415a0e7c42c4a2c04fe1f58ff6402c.png)

I hope I understood the need correctly

Kris

---

<div class="post-metadata">

**Author:** ![Yann\_Buccellato](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yann\_Buccellato](https://community.dynatrace.com/u/Yann_Buccellato)\
**Post date:** [July 23, 2024, 3:10pm UTC](https://community.dynatrace.com/t/dql-dpl-summarize/46727/3 "2024-07-23T15:10:59Z")

</div>

I adapted it based on your clear explanation given your understanding and it works perfectly.

 ![y_buccellato_0-1721747447069.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/e265caf4e85672fac313aa5aad14abc72bec64ec.png)

Thank you
