Filter event log ids should be strings

Based on the boto docs, eventId should be returned as a string.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html#CloudWatchLogs.Client.filter_log_events
This commit is contained in:
William Richard 2018-10-01 16:30:23 -04:00
parent dfa7935e13
commit 3afb2862c0
No known key found for this signature in database
GPG Key ID: F7F8BA4DDBE1ABED
2 changed files with 6 additions and 2 deletions

View File

@ -19,7 +19,7 @@ class LogEvent:
def to_filter_dict(self):
return {
"eventId": self.eventId,
"eventId": str(self.eventId),
"ingestionTime": self.ingestionTime,
# "logStreamName":
"message": self.message,

View File

@ -121,4 +121,8 @@ def test_filter_logs_interleaved():
interleaved=True,
)
events = res['events']
events.should.have.length_of(2)
for original_message, resulting_event in zip(messages, events):
resulting_event['eventId'].should.equal(str(resulting_event['eventId']))
resulting_event['timestamp'].should.equal(original_message['timestamp'])
resulting_event['message'].should.equal(original_message['message'])