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):
4848 """Render record as the expected SSM message."""
4949 raise NotImplementedError ("Method not implemented" )
5050
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+
5266class _ValidCloudStatus (str , enum .Enum ):
5367 """This is a private class to enum valid cloud statuses."""
5468
You can’t perform that action at this time.
0 commit comments