# How to remove text from variable. Alerts

**URL:** https://discuss.elastic.co/t/how-to-remove-text-from-variable-alerts/352937
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [February 9, 2024, 1:13pm UTC](https://discuss.elastic.co/t/how-to-remove-text-from-variable-alerts/352937 "2024-02-09T13:13:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Nidro96](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nidro96/32/131607_2.png) [@Nidro96](https://discuss.elastic.co/u/Nidro96)
#### Post date: [February 9, 2024, 1:13pm UTC](https://discuss.elastic.co/t/how-to-remove-text-from-variable-alerts/352937/1 "2024-02-09T13:13:31Z")

</div>

Hi. First post, so I am sorry if this is in the wrong categorie.

I am trying to set up an alert for my system. I got everything working but having problems with formating the message sent to the users. I have the following

```auto
{
	"text": "Regarding **{{context.hits.0._source.url.path}}** at time {{context.hits.0._source.@timestamp}}" 
}

```

This is results in

Regarding **Data : /collect/usage/new/users** at time 2024-02-09T12:43:16.480Z

I want to remove the text part "Data : /collect/usage" and if possible replace the T in with a space and remove the Z.

I am a bit new to the system so I am having problem inserting any kind of code. Would like to use some kind of split function but not gotten it to work.

Any help appreciated

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 8, 2024, 1:13pm UTC](https://discuss.elastic.co/t/how-to-remove-text-from-variable-alerts/352937/2 "2024-03-08T13:13:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
