# Access heartbeat fields on rule action

**URL:** https://discuss.elastic.co/t/access-heartbeat-fields-on-rule-action/293955
**Category:** Synthetics
**Created:** [January 10, 2022, 11:22pm UTC](https://discuss.elastic.co/t/access-heartbeat-fields-on-rule-action/293955 "2022-01-10T23:22:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mojohoho](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mojohoho](https://discuss.elastic.co/u/mojohoho)
#### Post date: [January 10, 2022, 11:22pm UTC](https://discuss.elastic.co/t/access-heartbeat-fields-on-rule-action/293955/1 "2022-01-10T23:22:58Z")

</div>

I have a heartbeat monitor with custom fields and `fields_under_root: true`  
How can I access these custom fields in a rule action?

For example, I have the below monitor:

```auto
- type: http
  id: dummy-nonexistent-url3
  name: Dummy nonexistent url3
  enabled: true
  schedule: '@every 10s'
  urls: 
    - https://www.notrealurl6663.com
  ipv4: true
  ipv6: true
  mode: any
  fields:
    iAmACustomField: hello
  tags: [monitoring, dev]

```

And an uptime rule with below webhook connector body:

```auto
{
    "@timestamp": "{{date}}",
    "message": "{{state.latestErrorMessage}}",
    "alert.id": "{{alert.id}}",
    "alert.actionGroupName": "{{alert.actionGroupName}}",
    "alert.actionGroup": "{{alert.actionGroup}}",
    "state.monitorId": "{{state.monitorId}}",
    "state.monitorName": "{{state.monitorName}}",
    "rule.id": "{{rule.id}}",
    "rule.name": "{{rule.name}}",
    "rule.type": "{{rule.type}}",
    "rule.tags": "{{rule.tags}}",
    "state.isTriggered": "{{state.isTriggered}}",
    "state.monitorUrl": "{{state.monitorUrl}}",
    "state.monitorType": "{{state.monitorType}}",
    "state.currentTriggerStarted": "{{state.currentTriggerStarted}}",
    "state.firstCheckedAt": "{{state.firstCheckedAt}}",
    "state.lastCheckedAt": "{{state.lastCheckedAt}}",
    "state.firstTriggeredAt": "{{state.firstTriggeredAt}}",
    "state.lastTriggeredAt": "{{state.lastTriggeredAt}}",
    "state.lastResolvedAt": "{{state.lastResolvedAt}}",
    "state.observerHostname": "{{state.observerHostname}}",
    "state.statusMessage": "{{state.statusMessage}}",
    "iamacustomfield": "{{status.fields.iAmACustomField}}"
}

```

The webhook connector is logging these alert events to a data stream index and documents are created with all other specified values except for "iamacustomfield" which comes up empty.

I am using heartbeat v7.16.1

---

<div class="post-metadata">

### Author: ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)
#### Post date: [January 10, 2022, 11:49pm UTC](https://discuss.elastic.co/t/access-heartbeat-fields-on-rule-action/293955/2 "2022-01-10T23:49:43Z")

</div>

Unfortunately we don't support custom fields at the moment for alerting. Would you mind opening a github issue on [kibana](https://github.com/elastic/kibana/issues/new?assignees=&labels=&template=Feature_request.md) if it's a feature you'd like to see? If you could put a link to it here that'd be 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: [February 3, 2022, 11:50pm UTC](https://discuss.elastic.co/t/access-heartbeat-fields-on-rule-action/293955/3 "2022-02-03T23:50:11Z")

</div>

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