---
- name: Test accumulate within
  hosts: localhost
  sources:
    - name: Test
      ansible.eda.generic:
        payload:
          - name: alert1
            level: error
            code: 205
          - name: alert2
            level: warning
            code: 207
          - name: alert3
            level: error
            code: 205
          - name: alert11
            level: error
            code: 205
        event_delay: 60
        loop_delay: 30
  rules:
    - name: Throttle with threshold
      condition: event.level == 'error'
      throttle:
          accumulate_within: 5 minutes
          threshold: 3
          group_by_attributes:
             - event.level
             - event.code
      action:
        debug:
