# DQL - replacing all hexadecimal pattern

**URL:** <https://community.dynatrace.com/t/dql-replacing-all-hexadecimal-pattern/49045>\
**Category:** DQL\
**Tags:** dql, dpl\
**Created:** [November 25, 2024, 10:43am UTC](https://community.dynatrace.com/t/dql-replacing-all-hexadecimal-pattern/49045 "2024-11-25T10:43:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![y\_buccellato](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/y_buccellato/32/160_2.png) [@y\_buccellato](https://community.dynatrace.com/u/y_buccellato)\
**Post date:** [November 25, 2024, 10:43am UTC](https://community.dynatrace.com/t/dql-replacing-all-hexadecimal-pattern/49045/1 "2024-11-25T10:43:22Z")

</div>

Good morning community,

is there an easy way to replace any&nbsp;hexadecimal&nbsp; pattern from the text of a field?

Example:

```java
com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: HTTP operation failed invoking https://arturo.ciao.dynamics.com/api/data/v9.2/cchct_INTEGR_aaaa_bbbb_IN?MessageId=*&QueueId=2E5C906617521EDC&QualityOfService=ExactlyOnce with statusCode: 400.

```

How can I replace this value&nbsp;2E5C906617521EDC in any log line via DQL?

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:** [November 25, 2024, 5:06pm UTC](https://community.dynatrace.com/t/dql-replacing-all-hexadecimal-pattern/49045/2 "2024-11-25T17:06:27Z")

</div>

There are _ **replaceString** _ and _ **replacePattern** _ functions which can be helpful. I guess you want to replace not this specific value (2E5C906617521EDC), but similarly looking numbers, so the second one will be more suited.

Please note that besides example you gave there are many more hex numbers in the log line, so very simple pattern would replace too much:

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

To make it work we need to tell parser more, e.g. what is the surrounding of the number, e.g.:

```markup
data record(content="""com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: HTTP operation failed invoking https://arturo.ciao.dynamics.com/api/data/v9.2/cchct_INTEGR_aaaa_bbbb_IN?MessageId=*&QueueId=2E5C906617521EDC&QualityOfService=ExactlyOnce with statusCode: 400.""")
| fieldsAdd content_fixed=replacePattern(content, "'QueueId='HEXLONG", "QueueId=*")

```

The result look like:

 ![krzysztof_hoja_1-1732554366740.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/70f799cca94474bb46476a8e5ac3cd109db73a47.png)
