Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow mapping event types to groups using regexes
Up until now, in order to associate an event type with an event group, we needed to spell out events full name in settings file under appropriate event group category and level. Some of the providers have hundreds of event types, which makes filling all this information in tedious and error prone. Not to mention that settings file is now one giant pile of event types. In order to make process of registering event types scale a bit better, this commit adds support for registering a class of event types that match specified regular expressions. Simple example: :ems: :ems_dummy: :event_handling: :event_groups: :addition: :critical: - dummy_event01_add - dummy_event02_add :detail: - dummy_event03_add - dummy_event04_add ... - dummy_event70_add - dm_event_create This can now be written as :ems: :ems_dummy: :event_handling: :event_groups: :addition: :critical: - dummy_event01_add - dummy_event02_add :detail: - dm_event_create - !ruby/regexp /^dummy_event[0-9]{2}_add$/ We took a great deal of care not to break existing code, so non-regex event type mappings take precedence over regular expression matches. For example, in our sample above, dummy_event_02_add gets assigned critical level despite also matching detail regex. Note that if sets of event types that are matched by regular expressions are not disjoint, then there will be multiple valid event type mappings. In this case, event types that match more than one group and/or level get assigned an arbitrary one.
- Loading branch information