# PagerDuty connector action breaks on \\n present in any data inserted with Mustache in custom\_details section

**URL:** <https://discuss.elastic.co/t/pagerduty-connector-action-breaks-on-n-present-in-any-data-inserted-with-mustache-in-custom-details-section/382806>\
**Category:** Kibana\
**Tags:** connectors\
**Created:** [October 17, 2025, 11:44am UTC](https://discuss.elastic.co/t/pagerduty-connector-action-breaks-on-n-present-in-any-data-inserted-with-mustache-in-custom-details-section/382806 "2025-10-17T11:44:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tofijak](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@tofijak](https://discuss.elastic.co/u/tofijak)\
**Post date:** [October 17, 2025, 11:44am UTC](https://discuss.elastic.co/t/pagerduty-connector-action-breaks-on-n-present-in-any-data-inserted-with-mustache-in-custom-details-section/382806/1 "2025-10-17T11:44:37Z")

</div>

Hi,

We are using the PagerDuty connector and have a rule that triggers on any error logs. We want to be able to pass the errors messages in the `custom_details` attribute, which is required to valid JSON.

This is what we have defined in the `custom_details` section.

```json
{

"rule_name": "{{rule.name}}",

"all_error_messages": "{{#context.hits}} Error: {{{_source.message}}} ------- {{/context.hits}}",

"error_count": "{{context.value}}",

"see_error_logs": "{{context.link}}",

"see_rule": "{{rule.url}}"

}

```

If the `_source.message` contains a string that includes `\n` then the action never succeeds, but also doesn’t fail - I’m not sure where to find any logs regarding the execution of this action and possibly an error message?

I suspect that the `\n` that are part of the message breaks the JSON and invalidates it causing the action to not succeed.

Any help on this issue will be greatly appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [October 20, 2025, 9:36am UTC](https://discuss.elastic.co/t/pagerduty-connector-action-breaks-on-n-present-in-any-data-inserted-with-mustache-in-custom-details-section/382806/2 "2025-10-20T09:36:26Z")

</div>

Hello @tofijak

Welcome to the Community!!

Could you please check the kibana logs if we see any errors related to action part execution ?

If the source\_message does not contains \n you see that action part execution successful?

Thanks!!

---

<div class="post-metadata">

**Author:** ![tofijak](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@tofijak](https://discuss.elastic.co/u/tofijak)\
**Post date:** [October 21, 2025, 1:27pm UTC](https://discuss.elastic.co/t/pagerduty-connector-action-breaks-on-n-present-in-any-data-inserted-with-mustache-in-custom-details-section/382806/3 "2025-10-21T13:27:06Z")

</div>

Hi @Tortoise

I see no errors in the kibana event logs.

For that specific execution I see 4 documents with the following values for `event-action: execute-start | new-instance | active-instance | execute-action | execute` - Logged in the same order.

The `execute` step has an `event.outcome: success` but in the execution history (see attached image) - You’ll see that `Succeeded actions` and `Errored actions` are set to 0.

![Screenshot 2025-10-21 at 15.21.19](https://us1.discourse-cdn.com/elastic/optimized/3X/3/2/32b260b4be9f5fefa74c84e68490ef3d3a245103_2_690x20.png)

If I repeat it without the \n in the source\_message it will succeed and mark `Succeeded actions` with a 1.
