Skip to content

Commit

Permalink
Add RawPath, ContentLength and Tags to mapping (#157)
Browse files Browse the repository at this point in the history
This PR permit to add these fields for elasticsearch : RawPath, ContentLength and Tags.
  • Loading branch information
tavinnhan authored and buger committed Nov 5, 2019
1 parent 2da7f2f commit c0cf0fb
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions pumps/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,19 +185,22 @@ func getMapping(datum analytics.AnalyticsRecord, extendedStatistics bool, genera
record := datum

mapping := map[string]interface{}{
"@timestamp": record.TimeStamp,
"http_method": record.Method,
"request_uri": record.Path,
"response_code": record.ResponseCode,
"ip_address": record.IPAddress,
"api_key": record.APIKey,
"api_version": record.APIVersion,
"api_name": record.APIName,
"api_id": record.APIID,
"org_id": record.OrgID,
"oauth_id": record.OauthID,
"request_time_ms": record.RequestTime,
"alias": record.Alias,
"@timestamp": record.TimeStamp,
"http_method": record.Method,
"request_uri": record.Path,
"request_uri_full": record.RawPath,
"response_code": record.ResponseCode,
"ip_address": record.IPAddress,
"api_key": record.APIKey,
"api_version": record.APIVersion,
"api_name": record.APIName,
"api_id": record.APIID,
"org_id": record.OrgID,
"oauth_id": record.OauthID,
"request_time_ms": record.RequestTime,
"alias": record.Alias,
"content_length": record.ContentLength,
"tags": record.Tags,
}

if extendedStatistics {
Expand Down

0 comments on commit c0cf0fb

Please sign in to comment.