# Dynamically create Pagerduty integrations

**URL:** https://discuss.elastic.co/t/dynamically-create-pagerduty-integrations/156762
**Category:** Elasticsearch
**Created:** [November 14, 2018, 11:36pm UTC](https://discuss.elastic.co/t/dynamically-create-pagerduty-integrations/156762 "2018-11-14T23:36:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![djtecha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/djtecha/32/54011_2.png) [@djtecha](https://discuss.elastic.co/u/djtecha)
#### Post date: [November 14, 2018, 11:36pm UTC](https://discuss.elastic.co/t/dynamically-create-pagerduty-integrations/156762/1 "2018-11-14T23:36:44Z")

</div>

Is there a way to use the API to create pagerduty accounts for xpack watcher actions? Or do you have to define them in the elasticsearch.yml file and restart every node every time? because that would be insane 🙂

---

<div class="post-metadata">

### Author: ![djtecha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/djtecha/32/54011_2.png) [@djtecha](https://discuss.elastic.co/u/djtecha)
#### Post date: [November 15, 2018, 1:05am UTC](https://discuss.elastic.co/t/dynamically-create-pagerduty-integrations/156762/2 "2018-11-15T01:05:42Z")

</div>

Like... This post gets called but then it still sends to my default integration

````auto
{
  "persistent": {
    "xpack": {
      "notification": {
        "pagerduty": {
          "default_account": "monitoring",
          "account": {
            "elasticsearch-logs": {
              "service_api_key": "32489287429387"
            },
            "kibana-logs": {
              "service_api_key": "23489237492234"
            },
            "logstash-logs": {
              "service_api_key": "23487234982734"
            }
          }
        }
      }
    }
  }
}```
````

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [November 26, 2018, 3:59pm UTC](https://discuss.elastic.co/t/dynamically-create-pagerduty-integrations/156762/3 "2018-11-26T15:59:20Z")

</div>

you can create pagerduty accounts using the command line keystore tool (so they are stored securely). See [https://www.elastic.co/guide/en/elastic-stack-overview/6.5/actions-pagerduty.html#configuring-pagerduty](https://www.elastic.co/guide/en/elastic-stack-overview/6.5/actions-pagerduty.html#configuring-pagerduty)

You can dynamically reload the secure settings, see [https://www.elastic.co/guide/en/elasticsearch/reference/6.5/secure-settings.html#reloadable-secure-settings](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/secure-settings.html#reloadable-secure-settings)

Hope this helps!

---

<div class="post-metadata">

### Author: ![djtecha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/djtecha/32/54011_2.png) [@djtecha](https://discuss.elastic.co/u/djtecha)
#### Post date: [November 29, 2018, 12:56am UTC](https://discuss.elastic.co/t/dynamically-create-pagerduty-integrations/156762/4 "2018-11-29T00:56:03Z")

</div>

Interesting, yea so the name has to exist in the keystore otherwise it uses the first one found... That could be documented better imho. Also, this means there is no way to dynamically control this? as in even if I wanted plain text I couldn't? Or is there some encryption in ES I could use to store it in the cluster vs rolling it out to ever single node and restarting each one. I'm not on 6.5 yet so I don't have the option to run that update keystore part.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [November 29, 2018, 9:43am UTC](https://discuss.elastic.co/t/dynamically-create-pagerduty-integrations/156762/5 "2018-11-29T09:43:57Z")

</div>

you could still use the update cluster settings API to store the service key in 6.x

---

<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: [December 27, 2018, 9:44am UTC](https://discuss.elastic.co/t/dynamically-create-pagerduty-integrations/156762/6 "2018-12-27T09:44:02Z")

</div>

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