# Split or cut from context\_hits iteration in Elasticsearch query rule

**URL:** <https://discuss.elastic.co/t/split-or-cut-from-context-hits-iteration-in-elasticsearch-query-rule/330521>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [April 21, 2023, 1:13pm UTC](https://discuss.elastic.co/t/split-or-cut-from-context-hits-iteration-in-elasticsearch-query-rule/330521 "2023-04-21T13:13:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josep\_Martinez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/josep_martinez/32/98140_2.png) [@Josep\_Martinez](https://discuss.elastic.co/u/Josep_Martinez)\
**Post date:** [April 21, 2023, 1:13pm UTC](https://discuss.elastic.co/t/split-or-cut-from-context-hits-iteration-in-elasticsearch-query-rule/330521/1 "2023-04-21T13:13:57Z")

</div>

Hello.

I'm newbie in Elasticsearch monitoring.

I'm trying to get only a few strings or characters from an context\_hits iteration like this:

```auto
{{#context.hits}}
{{_source.message}}
{{/context.hits}}

```

I have too many information in message field. I would like to use only a few words or characters from this field to report in slack message action. Is any way to cut, split or some other method to do this?

Regards.

---

<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:** [May 19, 2023, 1:14pm UTC](https://discuss.elastic.co/t/split-or-cut-from-context-hits-iteration-in-elasticsearch-query-rule/330521/2 "2023-05-19T13:14:22Z")

</div>

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