Skip to content

Commit 6dc53a3

Browse files
author
Mike Brennan
committed
fixes
1 parent 3a2de2c commit 6dc53a3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
30.3 MB
Binary file not shown.

tools/lambda-promtail/lambda-promtail/s3.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package main
22

33
import (
44
"bufio"
5-
"bytes"
65
"compress/gzip"
76
"context"
87
"encoding/json"
@@ -198,7 +197,9 @@ func parseS3Log(ctx context.Context, b *batch, labels map[string]string, obj io.
198197
if labels["type"] == CLOUDTRAIL_LOG_TYPE {
199198
records := make(chan Record)
200199
jsonStream := NewJSONStream(records)
201-
go jsonStream.Start(reader, parser.skipHeaderCount)
200+
// CloudTrail logs are always gzipped, so reader is always a *gzip.Reader (io.ReadCloser)
201+
readCloser := reader.(io.ReadCloser)
202+
go jsonStream.Start(readCloser, parser.skipHeaderCount)
202203
// Stream json file
203204
for record := range jsonStream.records {
204205
if record.Error != nil {

0 commit comments

Comments
 (0)