File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,21 @@ def ssm_message(self):
48
48
"""Render record as the expected SSM message."""
49
49
raise NotImplementedError ("Method not implemented" )
50
50
51
-
51
+ def serialization_message (self ):
52
+ """Render record as the expected logstash message."""
53
+ opts = {
54
+ "by_alias" : True ,
55
+ "exclude_none" : True ,
56
+ }
57
+ # NOTE(acostatnini): part related to the definition of the logstash message to be
58
+ # serialized before to send data
59
+ # NOTE(aloga): do not iter over the dictionary returned by record.dict() as this
60
+ # is just a dictionary representation of the object, where no serialization is
61
+ # done. In order to get objects correctly serialized we need to convert to JSON,
62
+ # then reload the model
63
+ serialized_record = json .loads (self .json (** opts ))
64
+ return serialized_record
65
+
52
66
class _ValidCloudStatus (str , enum .Enum ):
53
67
started = "started"
54
68
completed = "completed"
You can’t perform that action at this time.
0 commit comments