diff --git a/logs/action.go b/logs/action.go index 9bb602d8bc347521fa36ee5464acfeff159af29e..423fd3cc7cb144dfed49def2ab64f543fe770721 100644 --- a/logs/action.go +++ b/logs/action.go @@ -157,7 +157,7 @@ type RelativeActionLog struct { StartMs int64 `json:"start_ms" doc:"Start time in milliseconds after start timestamp"` EndMs int64 `json:"end_ms" doc:"End time in milliseconds after start timestamp"` DurMs int64 `json:"duration_ms"` //duration in milliseconds - Type ActionType `json:"type" doc:"Type is api-call|sqs-sent|sql-query|sleep"` + Type ActionType `json:"type" doc:"Type is api-call|sqs-sent|sql-query|sleep" search:"keyword"` ApiCall *ApiCallLog `json:"api_call,omitempty"` SQSSent *SQSSentLog `json:"sqs_sent,omitempty"` SQLQuery *SQLQueryLog `json:"sql_query,omitempty"` @@ -183,9 +183,9 @@ const ( //APICallLog captures details of an outgoing API call made from a handler type ApiCallLog struct { - URL string `json:"url"` - Method string `json:"method"` - ResponseCode int `json:"response_code"` + URL string `json:"url" search:"keyword"` + Method string `json:"method" search:"keyword"` + ResponseCode int `json:"response_code" search:"keyword"` Request *BodyLog `json:"request,omitempty"` Response *BodyLog `json:"response,omitempty"` } @@ -197,8 +197,8 @@ type BodyLog struct { //SQSSentLog captures details of an SQS event sent from a handler type SQSSentLog struct { - QueueName string `json:"queue_name"` - MessageType string `json:"message_type"` + QueueName string `json:"queue_name" search:"keyword"` + MessageType string `json:"message_type" search:"keyword"` Request *BodyLog `json:"request,omitempty"` } diff --git a/logs/api-logs.go b/logs/api-logs.go index 9552e107271595e2ee3d516b70171c9328e934c5..01900b2df0daf485ddacd613bf29c2d07f2a6263 100644 --- a/logs/api-logs.go +++ b/logs/api-logs.go @@ -108,17 +108,17 @@ type ApiLog struct { StartTime time.Time `json:"start_time"` EndTime time.Time `json:"end_time"` DurMs int64 `json:"duration_ms"` //duration in milliseconds - Method string `json:"method"` + Method string `json:"method" search:"keyword"` Address string `json:"address"` //server address for incoming and outgoing - Path string `json:"path"` - ResponseCode int `json:"response_code"` - RequestID string `json:"request_id"` - InitialAuthUsername string `json:"initial_auth_username,omitempty"` - InitialAuthType string `json:"initial_auth_type,omitempty"` - AccountID int64 `json:"account_id,omitempty"` - Username string `json:"username,omitempty"` - SourceIP string `json:"source_ip,omitempty"` //only logged for incoming API - UserAgent string `json:"user_agent,omitempty"` //only for incoming, indicate type of browser when UI + Path string `json:"path" search:"keyword"` + ResponseCode int `json:"response_code" search:"keyword"` + RequestID string `json:"request_id" search:"keyword"` + InitialAuthUsername string `json:"initial_auth_username,omitempty" search:"keyword"` + InitialAuthType string `json:"initial_auth_type,omitempty" search:"keyword"` + AccountID int64 `json:"account_id,omitempty" search:"keyword"` + Username string `json:"username,omitempty" search:"keyword"` + SourceIP string `json:"source_ip,omitempty" search:"keyword"` //only logged for incoming API + UserAgent string `json:"user_agent,omitempty"` //only for incoming, indicate type of browser when UI RelevantID string `json:"relevant_id,omitempty"` Request ApiLogRequest `json:"request"` Response ApiLogResponse `json:"response"` @@ -128,8 +128,8 @@ type ApiLog struct { type ApiLogRequest struct { Headers map[string]string `json:"headers,omitempty"` QueryParameters map[string]string `json:"query_parameters,omitempty"` - BodySize int `json:"body_size"` //set even when body is truncated/omitted - Body string `json:"body,omitempty"` //json body as a string + BodySize int `json:"body_size" search:"long"` //set even when body is truncated/omitted + Body string `json:"body,omitempty"` //json body as a string } type ApiLogResponse struct { diff --git a/search/time_series.go b/search/time_series.go index 152e81fab3fa8502356eb4e893cd937ffaafbc6b..8f766eaccf15962b212baf904329414fc4c8262f 100644 --- a/search/time_series.go +++ b/search/time_series.go @@ -102,7 +102,7 @@ func (w *writer) TimeSeries(name string, tmpl interface{}) (TimeSeries, error) { if err != nil { return nil, errors.Wrapf(err, "failed to marshal index mappings") } - logger.Debugf("%s Index Mappings: %s", structType, string(ts.jsonMappings)) + logger.Infof("%s Index Mappings: %s", structType, string(ts.jsonMappings)) //define search response type //similar to SearchResponseBody