Skip to content
This repository was archived by the owner on Sep 9, 2022. It is now read-only.

Commit 4a18177

Browse files
committed
Merge changed
2 parents 91eb488 + 554fa15 commit 4a18177

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pumps/graylog.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/TykTechnologies/tyk-pump/analytics"
88
"github.com/mitchellh/mapstructure"
99
"github.com/robertkowalski/graylog-golang"
10-
"strconv"
1110
)
1211

1312
type GraylogPump struct {
@@ -97,23 +96,23 @@ func (p *GraylogPump) WriteData(data []interface{}) error {
9796
mapping := map[string]interface{}{
9897
"method": record.Method,
9998
"path": record.Path,
100-
"response_code": strconv.Itoa(record.ResponseCode),
99+
"response_code": record.ResponseCode,
101100
"api_key": record.APIKey,
102101
"api_version": record.APIVersion,
103102
"api_name": record.APIName,
104103
"api_id": record.APIID,
105104
"org_id": record.OrgID,
106105
"oauth_id": record.OauthID,
107106
"raw_request": string(rReq),
108-
"request_time": strconv.Itoa(int(record.RequestTime)),
107+
"request_time": record.RequestTime,
109108
"raw_response": string(rResp),
110109
}
111110

112-
messageMap := map[string]string{}
111+
messageMap := map[string]interface{}{}
113112

114113
for _, key := range p.conf.Tags {
115114
if value, ok := mapping[key]; ok {
116-
messageMap[key] = value.(string)
115+
messageMap[key] = value
117116
}
118117
}
119118

0 commit comments

Comments
 (0)