Format event payload based on target format.
(self, event: SIEMEvent)
| 68 | def _format_payload(self, event: SIEMEvent) -> dict: |
| 69 | """Format event payload based on target format.""" |
| 70 | if self.format == "slack": |
| 71 | return self._format_slack(event) |
| 72 | elif self.format == "discord": |
| 73 | return self._format_discord(event) |
| 74 | elif self.format == "pagerduty": |
| 75 | return self._format_pagerduty(event) |
| 76 | else: |
| 77 | return event.to_dict() |
| 78 | |
| 79 | def _format_slack(self, event: SIEMEvent) -> dict: |
| 80 | """Format as Slack message.""" |
| 81 | color_map = { |
| 82 | "critical": "#FF0000", |
no test coverage detected