Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email_filters to pagerduty_service_integration of type generic_email_inbound_integration #88

Open
suls opened this issue Jun 1, 2018 · 7 comments

Comments

@suls
Copy link

suls commented Jun 1, 2018

Hi there,

I am using the generic_email_inbound_integration type of pagerduty_service_integration.
Being as it is, I heavily depend on some email filtering.

The pagerduty API itself seems to be a bit underdocumented (can't find a schema for this) but below is roughly the response of my manually created service integration.

https://api.pagerduty.com/services/__service__/integrations/__integration__

{
  "integration": {
    "type": "generic_email_inbound_integration",
    // snip
    "email_incident_creation": "on_new_email_subject",
    "email_filter_mode": "and-rules-email",
    "email_filters": [
      {
        "subject_mode": "no-match",
        "subject_regex": "__insert regex here__",
        "body_mode": "always",
        "body_regex": null,
        "from_email_mode": "always",
        "from_email_regex": null,
        "id": "__id__"
      }
    ],
    "email_parsers": null,
    "email_parsing_fallback": null
  }
}

Would you be interested in adding email_filters into your PagerDuty provider?

Cheers, Mathias

@paddie
Copy link
Contributor

paddie commented Aug 10, 2018

We were hit by this one as well. If there is support for this one, we might build it.

It might be nicer if the resource didn't have the email specific stuff at the top-level since it really only applies to the email thing. Maybe a specific email_integration resource would be a bit nicer?

@cregkly
Copy link

cregkly commented May 8, 2019

At the very least can we get the ability to set the Email Management config?

image

These are the values for email_incident_creation

  • Open a new alert for each trigger email. => "on_new_email"
  • Open a new alert for each new trigger email subject. => "on_new_email_subject"
  • Open a new alert only if an open incident does not already exist. => "only_if_no_open_incidents"
  • Accept all incoming email. => "use_rules",

I would also like to be able to set the custom emails rules. But looking at what is configured in the API I can appreciate how complicated the integration resource would become, all for one option, of one option, of an integration.

I think a dedicated email integration resource might be simpler.

@cregkly
Copy link

cregkly commented May 8, 2019

If it helps here is the payload I used for testing updating a custom rules via the API for my PRTG email integration

        'integration': {
            'type': 'generic_email_inbound_integration',
            'name': "Email",
            'email_incident_creation': "use_rules",
            'email_filter_mode': "all-email",
            'email_filters': [
                {
                    'subject_mode': "always",
                    'body_mode': "always",
                    'from_email_mode': "always",
                }
            ],
            'email_parsers': [
                {
                    'action': "resolve",
                    'match_predicate': {
                        'type': "any",
                        'children': [
                            {
                                'type': "contains",
                                'part': "subject",
                                'matcher': "Down ended"
                            },
                            {
                                'type': "contains",
                                'part': "subject",
                                'matcher': "Up"
                            },
                            {
                                'type': "contains",
                                'part': "subject",
                                'matcher': "Threshold not reached"
                            }
                        ]
                    },
                    'value_extractors': [
                        {
                            'type': "regex",
                            'value_name': "incident_key",
                            'part': "subject",
                            'regex': "([a-zA-Z0-9_\\-\\: ]*) ~ ([a-zA-Z0-9_\\-\\: ]*) ~ ([a-zA-Z0-9_\\-\\: ]*)"
                        }
                    ]

                },
                {
                    'action': "trigger",
                    'match_predicate': {
                        'type': "any",
                        'children': [
                            {
                                'type': "contains",
                                'part': "subject",
                                'matcher': "Down"
                            },
                            {
                                'type': "contains",
                                'part': "subject",
                                'matcher': "Threshold reached"
                            },
                            {
                                'type': "contains",
                                'part': "subject",
                                'matcher': "Warning"
                            }
                        ]
                    },
                    'value_extractors': [
                        {
                            'type': "regex",
                            'value_name': "incident_key",
                            'part': "subject",
                            'regex': "([a-zA-Z0-9_\\-\\: ]*) ~ ([a-zA-Z0-9_\\-\\: ]*) ~ ([a-zA-Z0-9_\\-\\: ]*)"
                        }
                    ]

                }
            ],
            'email_parsing_fallback': "open_new_incident"
        }
    }

@mattsimonsen
Copy link

email_incident_creation for pagerduty_service_integration would indeed be useful to many orgs

@JanMinervum
Copy link

I'm trying to migrate my PRTG PagerDuty configuration to Terraform, I'm stuck on this as well. Any updates on this?

@anhlqn
Copy link

anhlqn commented Nov 21, 2020

Same here. It's painful to manually create PRTG integration for many services.

@toughrogrammer
Copy link

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants