Skip to content

Commit

Permalink
Add another missing case to the google cloud output
Browse files Browse the repository at this point in the history
  • Loading branch information
camdencheek committed Jul 17, 2020
1 parent a6d3f1c commit 89dbd2e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugin/builtin/output/google_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ func (p *GoogleCloudOutput) createProtobufEntry(e *entry.Entry) (newEntry *logpb
case map[string]interface{}:
s := jsonMapToProtoStruct(p)
newEntry.Payload = &logpb.LogEntry_JsonPayload{JsonPayload: s}
case map[string]string:
fields := map[string]*structpb.Value{}
for k, v := range p {
fields[k] = jsonValueToStructValue(v)
}
newEntry.Payload = &logpb.LogEntry_JsonPayload{JsonPayload: &structpb.Struct{Fields: fields}}
default:
return nil, fmt.Errorf("cannot convert record of type %T to a protobuf representation", e.Record)
}
Expand Down

0 comments on commit 89dbd2e

Please sign in to comment.