# rename the result of replaceString

**URL:** <https://community.dynatrace.com/t/rename-the-result-of-replacestring/44335>\
**Category:** DQL\
**Tags:** dql\
**Created:** [February 27, 2024, 6:21pm UTC](https://community.dynatrace.com/t/rename-the-result-of-replacestring/44335 "2024-02-27T18:21:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GerryIsHere](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gerryishere/32/15590_2.png) [@GerryIsHere](https://community.dynatrace.com/u/GerryIsHere)\
**Post date:** [February 27, 2024, 6:21pm UTC](https://community.dynatrace.com/t/rename-the-result-of-replacestring/44335/1 "2024-02-27T18:21:18Z")

</div>

I have this query

fetch logs  
| filter matchesValue(host.name, “dar\*”)  
and matchesPhrase(log.source, “mydomain”)  
and matchesPhrase(log.source, “diagnostic”)  
and matchesValue(status, “ERROR”)  
| fieldsAdd replaceString(content, “\n”, " “)  
| parse replaceString(content, “\n”, " “), “LD 'Message=\”’ LD:message’\”’ LD ‘TransactionId’ LD”  
| fieldsKeep message

See the&nbsp;**parse replaceString(content, “\n”, " ")** part, isn’t that bizarre?

The documentation doesn’t tell me how to rename the result of replaceString and creates that weird field name. How can I give it a meaningful name to use in the **parse**?

thanks!

---

<div class="post-metadata">

**Author:** ![Miguel\_RinconG](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/miguel_rincong/32/29455_2.png) [@Miguel\_RinconG](https://community.dynatrace.com/u/Miguel_RinconG)\
**Post date:** [February 27, 2024, 7:50pm UTC](https://community.dynatrace.com/t/rename-the-result-of-replacestring/44335/2 "2024-02-27T19:50:19Z")

</div>

Hi&nbsp;[@GerryIsHere](https://community.dynatrace.com/user/72301)

It’s a [lines breaks](https://docs.dynatrace.com/docs/shortlink/dpl-lines-strings#beginning-of-string).&nbsp;I recommend use&nbsp;[replacePattern](https://docs.dynatrace.com/docs/shortlink/dpl-lines-strings#beginning-of-string) and [DPL](https://docs.dynatrace.com/docs/shortlink/dpl-dynatrace-pattern-language-hub).

 ![Miguel_RinconG_0-1709063357934.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/2/72ed244bc9d16a7c0c526b7c9863dab5a15c3052.png)

---

<div class="post-metadata">

**Author:** ![GerryIsHere](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gerryishere/32/15590_2.png) [@GerryIsHere](https://community.dynatrace.com/u/GerryIsHere)\
**Post date:** [February 27, 2024, 8:10pm UTC](https://community.dynatrace.com/t/rename-the-result-of-replacestring/44335/3 "2024-02-27T20:10:48Z")

</div>

I need the part at the end, not the part at the beginning. Are you saying use something like LD EOL LD EOL LD:lastline?

---

<div class="post-metadata">

**Author:** ![Miguel\_RinconG](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/miguel_rincong/32/29455_2.png) [@Miguel\_RinconG](https://community.dynatrace.com/u/Miguel_RinconG)\
**Post date:** [February 28, 2024, 1:44pm UTC](https://community.dynatrace.com/t/rename-the-result-of-replacestring/44335/4 "2024-02-28T13:44:04Z")

</div>

Hi,

For example the [EOS](https://docs.dynatrace.com/docs/shortlink/dpl-positional-matchers#end-of-string) use:

```markup
data record(content="_ga_22HX2S1N7P=GS1.1.1702351529.1.0.1702351529.0.0.0\" 3806 1945 ")
| parse content, "LD STRUCTURE{DOUBLE:bytes.re ' ' DOUBLE:bytes.send SPACE}?:struct EOS"
| fieldsAdd struct[bytes.re]
| fieldsAdd struct[bytes.send]

```

 ![Miguel_RinconG_0-1709127816883.png](https://global.discourse-cdn.com/dynatrace/original/2X/0/0106f7c0f481210f26b6bca5e95ded53068e2603.png)

---

<div class="post-metadata">

**Author:** ![GerryIsHere](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gerryishere/32/15590_2.png) [@GerryIsHere](https://community.dynatrace.com/u/GerryIsHere)\
**Post date:** [February 28, 2024, 7:32pm UTC](https://community.dynatrace.com/t/rename-the-result-of-replacestring/44335/5 "2024-02-28T19:32:46Z")

</div>

The solution is to use DATA and not LD, and forget about replaceString
