We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 599ec7e commit c537ca6Copy full SHA for c537ca6
elastalert_modules/__init__.py
elastalert_modules/bitsensor_enhancement.py
@@ -0,0 +1,12 @@
1
+from elastalert.enhancements import BaseEnhancement
2
+from util import convert_array_to_object
3
+
4
5
+class AlertTextEnhancement(BaseEnhancement):
6
+ # The enhancement is run against every match
7
+ # The match is passed to the process function where it can be modified in any way
8
+ # ElastAlert will do this for each enhancement linked to a rule
9
+ def process(self, match):
10
+ match['detections_string'] = ''
11
+ if 'detections' in match:
12
+ match['detections_parsed'] = convert_array_to_object(match['detections'])
elastalert_modules/util.py
@@ -0,0 +1,7 @@
+def convert_array_to_object(array):
+ json = {}
+ for idx in range(len(array)):
+ json[idx] = array[idx]
+ return json
0 commit comments