Просмотр исходного кода

perf: log index donot include reqid (#91)

* perf: log index donot include reqid

* fix: search reqid

* fix: search reqid
zijiren 9 месяцев назад
Родитель
Сommit
148a57c400
5 измененных файлов с 39 добавлено и 236 удалено
  1. 0 20
      controller/log.go
  2. 0 48
      docs/docs.go
  3. 0 48
      docs/swagger.json
  4. 0 32
      docs/swagger.yaml
  5. 39 88
      model/log.go

+ 0 - 20
controller/log.go

@@ -32,11 +32,9 @@ func parseCommonParams(c *gin.Context) (params struct {
 	tokenName  string
 	modelName  string
 	channelID  int
-	endpoint   string
 	tokenID    int
 	order      string
 	requestID  string
-	mode       int
 	codeType   string
 	withBody   bool
 	ip         string
@@ -46,11 +44,9 @@ func parseCommonParams(c *gin.Context) (params struct {
 	params.tokenName = c.Query("token_name")
 	params.modelName = c.Query("model_name")
 	params.channelID, _ = strconv.Atoi(c.Query("channel"))
-	params.endpoint = c.Query("endpoint")
 	params.tokenID, _ = strconv.Atoi(c.Query("token_id"))
 	params.order = c.Query("order")
 	params.requestID = c.Query("request_id")
-	params.mode, _ = strconv.Atoi(c.Query("mode"))
 	params.codeType = c.Query("code_type")
 	params.withBody, _ = strconv.ParseBool(c.Query("with_body"))
 	params.ip = c.Query("ip")
@@ -73,10 +69,8 @@ func parseCommonParams(c *gin.Context) (params struct {
 //	@Param			token_name		query		string	false	"Token name"
 //	@Param			model_name		query		string	false	"Model name"
 //	@Param			channel			query		int		false	"Channel ID"
-//	@Param			endpoint		query		string	false	"Endpoint"
 //	@Param			token_id		query		int		false	"Token ID"
 //	@Param			order			query		string	false	"Order"
-//	@Param			mode			query		int		false	"Mode"
 //	@Param			request_id		query		string	false	"Request ID"
 //	@Param			code_type		query		string	false	"Code type"
 //	@Param			with_body		query		bool	false	"With body"
@@ -99,9 +93,7 @@ func GetLogs(c *gin.Context) {
 		params.tokenID,
 		params.tokenName,
 		params.channelID,
-		params.endpoint,
 		params.order,
-		params.mode,
 		model.CodeType(params.codeType),
 		params.withBody,
 		params.ip,
@@ -131,11 +123,9 @@ func GetLogs(c *gin.Context) {
 //	@Param			token_name		query		string	false	"Token name"
 //	@Param			model_name		query		string	false	"Model name"
 //	@Param			channel			query		int		false	"Channel ID"
-//	@Param			endpoint		query		string	false	"Endpoint"
 //	@Param			token_id		query		int		false	"Token ID"
 //	@Param			order			query		string	false	"Order"
 //	@Param			request_id		query		string	false	"Request ID"
-//	@Param			mode			query		int		false	"Mode"
 //	@Param			code_type		query		string	false	"Code type"
 //	@Param			with_body		query		bool	false	"With body"
 //	@Param			ip				query		string	false	"IP"
@@ -162,9 +152,7 @@ func GetGroupLogs(c *gin.Context) {
 		params.tokenID,
 		params.tokenName,
 		params.channelID,
-		params.endpoint,
 		params.order,
-		params.mode,
 		model.CodeType(params.codeType),
 		params.withBody,
 		params.ip,
@@ -195,11 +183,9 @@ func GetGroupLogs(c *gin.Context) {
 //	@Param			token_name		query		string	false	"Filter by token name"
 //	@Param			model_name		query		string	false	"Filter by model name"
 //	@Param			channel			query		int		false	"Filter by channel"
-//	@Param			endpoint		query		string	false	"Filter by endpoint"
 //	@Param			token_id		query		int		false	"Filter by token id"
 //	@Param			order			query		string	false	"Order"
 //	@Param			request_id		query		string	false	"Request ID"
-//	@Param			mode			query		int		false	"Mode"
 //	@Param			code_type		query		string	false	"Code type"
 //	@Param			with_body		query		bool	false	"With body"
 //	@Param			ip				query		string	false	"IP"
@@ -217,7 +203,6 @@ func SearchLogs(c *gin.Context) {
 	result, err := model.SearchLogs(
 		group,
 		keyword,
-		params.endpoint,
 		params.requestID,
 		params.tokenID,
 		params.tokenName,
@@ -226,7 +211,6 @@ func SearchLogs(c *gin.Context) {
 		endTime,
 		params.channelID,
 		params.order,
-		params.mode,
 		model.CodeType(params.codeType),
 		params.withBody,
 		params.ip,
@@ -257,11 +241,9 @@ func SearchLogs(c *gin.Context) {
 //	@Param			token_name		query		string	false	"Filter by token name"
 //	@Param			model_name		query		string	false	"Filter by model name"
 //	@Param			channel			query		int		false	"Filter by channel"
-//	@Param			endpoint		query		string	false	"Filter by endpoint"
 //	@Param			token_id		query		int		false	"Filter by token id"
 //	@Param			order			query		string	false	"Order"
 //	@Param			request_id		query		string	false	"Request ID"
-//	@Param			mode			query		int		false	"Mode"
 //	@Param			code_type		query		string	false	"Code type"
 //	@Param			with_body		query		bool	false	"With body"
 //	@Param			ip				query		string	false	"IP"
@@ -283,7 +265,6 @@ func SearchGroupLogs(c *gin.Context) {
 	result, err := model.SearchGroupLogs(
 		group,
 		keyword,
-		params.endpoint,
 		params.requestID,
 		params.tokenID,
 		params.tokenName,
@@ -292,7 +273,6 @@ func SearchGroupLogs(c *gin.Context) {
 		endTime,
 		params.channelID,
 		params.order,
-		params.mode,
 		model.CodeType(params.codeType),
 		params.withBody,
 		params.ip,

+ 0 - 48
docs/docs.go

@@ -2257,12 +2257,6 @@ const docTemplate = `{
                         "name": "channel",
                         "in": "query"
                     },
-                    {
-                        "type": "string",
-                        "description": "Endpoint",
-                        "name": "endpoint",
-                        "in": "query"
-                    },
                     {
                         "type": "integer",
                         "description": "Token ID",
@@ -2281,12 +2275,6 @@ const docTemplate = `{
                         "name": "request_id",
                         "in": "query"
                     },
-                    {
-                        "type": "integer",
-                        "description": "Mode",
-                        "name": "mode",
-                        "in": "query"
-                    },
                     {
                         "type": "string",
                         "description": "Code type",
@@ -2459,12 +2447,6 @@ const docTemplate = `{
                         "name": "channel",
                         "in": "query"
                     },
-                    {
-                        "type": "string",
-                        "description": "Filter by endpoint",
-                        "name": "endpoint",
-                        "in": "query"
-                    },
                     {
                         "type": "integer",
                         "description": "Filter by token id",
@@ -2483,12 +2465,6 @@ const docTemplate = `{
                         "name": "request_id",
                         "in": "query"
                     },
-                    {
-                        "type": "integer",
-                        "description": "Mode",
-                        "name": "mode",
-                        "in": "query"
-                    },
                     {
                         "type": "string",
                         "description": "Code type",
@@ -2698,12 +2674,6 @@ const docTemplate = `{
                         "name": "channel",
                         "in": "query"
                     },
-                    {
-                        "type": "string",
-                        "description": "Endpoint",
-                        "name": "endpoint",
-                        "in": "query"
-                    },
                     {
                         "type": "integer",
                         "description": "Token ID",
@@ -2716,12 +2686,6 @@ const docTemplate = `{
                         "name": "order",
                         "in": "query"
                     },
-                    {
-                        "type": "integer",
-                        "description": "Mode",
-                        "name": "mode",
-                        "in": "query"
-                    },
                     {
                         "type": "string",
                         "description": "Request ID",
@@ -3066,12 +3030,6 @@ const docTemplate = `{
                         "name": "channel",
                         "in": "query"
                     },
-                    {
-                        "type": "string",
-                        "description": "Filter by endpoint",
-                        "name": "endpoint",
-                        "in": "query"
-                    },
                     {
                         "type": "integer",
                         "description": "Filter by token id",
@@ -3090,12 +3048,6 @@ const docTemplate = `{
                         "name": "request_id",
                         "in": "query"
                     },
-                    {
-                        "type": "integer",
-                        "description": "Mode",
-                        "name": "mode",
-                        "in": "query"
-                    },
                     {
                         "type": "string",
                         "description": "Code type",

+ 0 - 48
docs/swagger.json

@@ -2246,12 +2246,6 @@
                         "name": "channel",
                         "in": "query"
                     },
-                    {
-                        "type": "string",
-                        "description": "Endpoint",
-                        "name": "endpoint",
-                        "in": "query"
-                    },
                     {
                         "type": "integer",
                         "description": "Token ID",
@@ -2270,12 +2264,6 @@
                         "name": "request_id",
                         "in": "query"
                     },
-                    {
-                        "type": "integer",
-                        "description": "Mode",
-                        "name": "mode",
-                        "in": "query"
-                    },
                     {
                         "type": "string",
                         "description": "Code type",
@@ -2448,12 +2436,6 @@
                         "name": "channel",
                         "in": "query"
                     },
-                    {
-                        "type": "string",
-                        "description": "Filter by endpoint",
-                        "name": "endpoint",
-                        "in": "query"
-                    },
                     {
                         "type": "integer",
                         "description": "Filter by token id",
@@ -2472,12 +2454,6 @@
                         "name": "request_id",
                         "in": "query"
                     },
-                    {
-                        "type": "integer",
-                        "description": "Mode",
-                        "name": "mode",
-                        "in": "query"
-                    },
                     {
                         "type": "string",
                         "description": "Code type",
@@ -2687,12 +2663,6 @@
                         "name": "channel",
                         "in": "query"
                     },
-                    {
-                        "type": "string",
-                        "description": "Endpoint",
-                        "name": "endpoint",
-                        "in": "query"
-                    },
                     {
                         "type": "integer",
                         "description": "Token ID",
@@ -2705,12 +2675,6 @@
                         "name": "order",
                         "in": "query"
                     },
-                    {
-                        "type": "integer",
-                        "description": "Mode",
-                        "name": "mode",
-                        "in": "query"
-                    },
                     {
                         "type": "string",
                         "description": "Request ID",
@@ -3055,12 +3019,6 @@
                         "name": "channel",
                         "in": "query"
                     },
-                    {
-                        "type": "string",
-                        "description": "Filter by endpoint",
-                        "name": "endpoint",
-                        "in": "query"
-                    },
                     {
                         "type": "integer",
                         "description": "Filter by token id",
@@ -3079,12 +3037,6 @@
                         "name": "request_id",
                         "in": "query"
                     },
-                    {
-                        "type": "integer",
-                        "description": "Mode",
-                        "name": "mode",
-                        "in": "query"
-                    },
                     {
                         "type": "string",
                         "description": "Code type",

+ 0 - 32
docs/swagger.yaml

@@ -2531,10 +2531,6 @@ paths:
         in: query
         name: channel
         type: integer
-      - description: Endpoint
-        in: query
-        name: endpoint
-        type: string
       - description: Token ID
         in: query
         name: token_id
@@ -2547,10 +2543,6 @@ paths:
         in: query
         name: request_id
         type: string
-      - description: Mode
-        in: query
-        name: mode
-        type: integer
       - description: Code type
         in: query
         name: code_type
@@ -2657,10 +2649,6 @@ paths:
         in: query
         name: channel
         type: integer
-      - description: Filter by endpoint
-        in: query
-        name: endpoint
-        type: string
       - description: Filter by token id
         in: query
         name: token_id
@@ -2673,10 +2661,6 @@ paths:
         in: query
         name: request_id
         type: string
-      - description: Mode
-        in: query
-        name: mode
-        type: integer
       - description: Code type
         in: query
         name: code_type
@@ -2829,10 +2813,6 @@ paths:
         in: query
         name: channel
         type: integer
-      - description: Endpoint
-        in: query
-        name: endpoint
-        type: string
       - description: Token ID
         in: query
         name: token_id
@@ -2841,10 +2821,6 @@ paths:
         in: query
         name: order
         type: string
-      - description: Mode
-        in: query
-        name: mode
-        type: integer
       - description: Request ID
         in: query
         name: request_id
@@ -3029,10 +3005,6 @@ paths:
         in: query
         name: channel
         type: integer
-      - description: Filter by endpoint
-        in: query
-        name: endpoint
-        type: string
       - description: Filter by token id
         in: query
         name: token_id
@@ -3045,10 +3017,6 @@ paths:
         in: query
         name: request_id
         type: string
-      - description: Mode
-        in: query
-        name: mode
-        type: integer
       - description: Code type
         in: query
         name: code_type

+ 39 - 88
model/log.go

@@ -114,11 +114,11 @@ func CreateLogIndexes(db *gorm.DB) error {
 	} else {
 		indexes = []string{
 			// used by global search logs
-			"CREATE INDEX IF NOT EXISTS idx_model_reqat ON logs (model, request_at DESC) INCLUDE (code, request_id, downstream_result)",
+			"CREATE INDEX IF NOT EXISTS idx_model_reqat ON logs (model, request_at DESC) INCLUDE (code, downstream_result)",
 			// used by global search logs
-			"CREATE INDEX IF NOT EXISTS idx_channel_reqat ON logs (channel_id, request_at DESC) INCLUDE (code, request_id, downstream_result)",
+			"CREATE INDEX IF NOT EXISTS idx_channel_reqat ON logs (channel_id, request_at DESC) INCLUDE (code, downstream_result)",
 			// used by global search logs
-			"CREATE INDEX IF NOT EXISTS idx_channel_model_reqat ON logs (channel_id, model, request_at DESC) INCLUDE (code, request_id, downstream_result)",
+			"CREATE INDEX IF NOT EXISTS idx_channel_model_reqat ON logs (channel_id, model, request_at DESC) INCLUDE (code, downstream_result)",
 
 			// global hour indexes, used by global dashboard
 			"CREATE INDEX IF NOT EXISTS idx_model_trunchour ON logs (model, timestamp_trunc_by_hour) INCLUDE (downstream_result)",
@@ -126,13 +126,13 @@ func CreateLogIndexes(db *gorm.DB) error {
 			"CREATE INDEX IF NOT EXISTS idx_channel_model_trunchour ON logs (channel_id, model, timestamp_trunc_by_hour) INCLUDE (downstream_result)",
 
 			// used by search group logs
-			"CREATE INDEX IF NOT EXISTS idx_group_reqat ON logs (group_id, request_at DESC) INCLUDE (code, request_id, downstream_result)",
+			"CREATE INDEX IF NOT EXISTS idx_group_reqat ON logs (group_id, request_at DESC) INCLUDE (code, downstream_result)",
 			// used by search group logs
-			"CREATE INDEX IF NOT EXISTS idx_group_token_reqat ON logs (group_id, token_name, request_at DESC) INCLUDE (code, request_id, downstream_result)",
+			"CREATE INDEX IF NOT EXISTS idx_group_token_reqat ON logs (group_id, token_name, request_at DESC) INCLUDE (code, downstream_result)",
 			// used by search group logs
-			"CREATE INDEX IF NOT EXISTS idx_group_model_reqat ON logs (group_id, model, request_at DESC) INCLUDE (code, request_id, downstream_result)",
+			"CREATE INDEX IF NOT EXISTS idx_group_model_reqat ON logs (group_id, model, request_at DESC) INCLUDE (code, downstream_result)",
 			// used by search group logs
-			"CREATE INDEX IF NOT EXISTS idx_group_token_model_reqat ON logs (group_id, token_name, model, request_at DESC) INCLUDE (code, request_id, downstream_result)",
+			"CREATE INDEX IF NOT EXISTS idx_group_token_model_reqat ON logs (group_id, token_name, model, request_at DESC) INCLUDE (code, downstream_result)",
 
 			// hour indexes, used by dashboard
 			"CREATE INDEX IF NOT EXISTS idx_group_trunchour ON logs (group_id, timestamp_trunc_by_hour DESC) INCLUDE (downstream_result)",
@@ -458,14 +458,19 @@ func buildGetLogsQuery(
 	tokenID int,
 	tokenName string,
 	channelID int,
-	endpoint string,
-	mode int,
 	codeType CodeType,
 	ip string,
 	resultOnly bool,
 ) *gorm.DB {
 	tx := LogDB.Model(&Log{})
 
+	if requestID != "" {
+		tx = tx.Where("request_id = ?", requestID)
+	}
+	if ip != "" {
+		tx = tx.Where("ip = ?", ip)
+	}
+
 	if group == "" {
 		tx = tx.Where("group_id = ''")
 	} else if group != "*" {
@@ -477,6 +482,9 @@ func buildGetLogsQuery(
 	if tokenName != "" {
 		tx = tx.Where("token_name = ?", tokenName)
 	}
+	if channelID != 0 {
+		tx = tx.Where("channel_id = ?", channelID)
+	}
 
 	switch {
 	case !startTimestamp.IsZero() && !endTimestamp.IsZero():
@@ -487,8 +495,8 @@ func buildGetLogsQuery(
 		tx = tx.Where("request_at <= ?", endTimestamp)
 	}
 
-	if requestID != "" {
-		tx = tx.Where("request_id = ?", requestID)
+	if resultOnly {
+		tx = tx.Where("downstream_result = true")
 	}
 
 	switch codeType {
@@ -498,25 +506,9 @@ func buildGetLogsQuery(
 		tx = tx.Where("code != 200")
 	}
 
-	if resultOnly {
-		tx = tx.Where("downstream_result = true")
-	}
-
-	if channelID != 0 {
-		tx = tx.Where("channel_id = ?", channelID)
-	}
 	if tokenID != 0 {
 		tx = tx.Where("token_id = ?", tokenID)
 	}
-	if ip != "" {
-		tx = tx.Where("ip = ?", ip)
-	}
-	if mode != 0 {
-		tx = tx.Where("mode = ?", mode)
-	}
-	if endpoint != "" {
-		tx = tx.Where("endpoint = ?", endpoint)
-	}
 	return tx
 }
 
@@ -529,9 +521,7 @@ func getLogs(
 	tokenID int,
 	tokenName string,
 	channelID int,
-	endpoint string,
 	order string,
-	mode int,
 	codeType CodeType,
 	withBody bool,
 	ip string,
@@ -554,8 +544,6 @@ func getLogs(
 			tokenID,
 			tokenName,
 			channelID,
-			endpoint,
-			mode,
 			codeType,
 			ip,
 			resultOnly,
@@ -572,8 +560,6 @@ func getLogs(
 			tokenID,
 			tokenName,
 			channelID,
-			endpoint,
-			mode,
 			codeType,
 			ip,
 			resultOnly,
@@ -610,9 +596,7 @@ func GetLogs(
 	tokenID int,
 	tokenName string,
 	channelID int,
-	endpoint string,
 	order string,
-	mode int,
 	codeType CodeType,
 	withBody bool,
 	ip string,
@@ -634,7 +618,7 @@ func GetLogs(
 
 	g.Go(func() error {
 		var err error
-		total, logs, err = getLogs(group, startTimestamp, endTimestamp, modelName, requestID, tokenID, tokenName, channelID, endpoint, order, mode, codeType, withBody, ip, page, perPage, resultOnly)
+		total, logs, err = getLogs(group, startTimestamp, endTimestamp, modelName, requestID, tokenID, tokenName, channelID, order, codeType, withBody, ip, page, perPage, resultOnly)
 		return err
 	})
 
@@ -660,9 +644,7 @@ func GetGroupLogs(
 	tokenID int,
 	tokenName string,
 	channelID int,
-	endpoint string,
 	order string,
-	mode int,
 	codeType CodeType,
 	withBody bool,
 	ip string,
@@ -685,7 +667,7 @@ func GetGroupLogs(
 
 	g.Go(func() error {
 		var err error
-		total, logs, err = getLogs(group, startTimestamp, endTimestamp, modelName, requestID, tokenID, tokenName, channelID, endpoint, order, mode, codeType, withBody, ip, page, perPage, resultOnly)
+		total, logs, err = getLogs(group, startTimestamp, endTimestamp, modelName, requestID, tokenID, tokenName, channelID, order, codeType, withBody, ip, page, perPage, resultOnly)
 		return err
 	})
 
@@ -718,7 +700,6 @@ func GetGroupLogs(
 func buildSearchLogsQuery(
 	group string,
 	keyword string,
-	endpoint string,
 	requestID string,
 	tokenID int,
 	tokenName string,
@@ -726,13 +707,19 @@ func buildSearchLogsQuery(
 	startTimestamp time.Time,
 	endTimestamp time.Time,
 	channelID int,
-	mode int,
 	codeType CodeType,
 	ip string,
 	resultOnly bool,
 ) *gorm.DB {
 	tx := LogDB.Model(&Log{})
 
+	if requestID != "" {
+		tx = tx.Where("request_id = ?", requestID)
+	}
+	if ip != "" {
+		tx = tx.Where("ip = ?", ip)
+	}
+
 	if group == "" {
 		tx = tx.Where("group_id = ''")
 	} else if group != "*" {
@@ -744,6 +731,9 @@ func buildSearchLogsQuery(
 	if tokenName != "" {
 		tx = tx.Where("token_name = ?", tokenName)
 	}
+	if channelID != 0 {
+		tx = tx.Where("channel_id = ?", channelID)
+	}
 
 	switch {
 	case !startTimestamp.IsZero() && !endTimestamp.IsZero():
@@ -754,8 +744,8 @@ func buildSearchLogsQuery(
 		tx = tx.Where("request_at <= ?", endTimestamp)
 	}
 
-	if requestID != "" {
-		tx = tx.Where("request_id = ?", requestID)
+	if resultOnly {
+		tx = tx.Where("downstream_result = true")
 	}
 
 	switch codeType {
@@ -765,31 +755,19 @@ func buildSearchLogsQuery(
 		tx = tx.Where("code != 200")
 	}
 
-	if resultOnly {
-		tx = tx.Where("downstream_result = true")
-	}
-
-	if channelID != 0 {
-		tx = tx.Where("channel_id = ?", channelID)
-	}
 	if tokenID != 0 {
 		tx = tx.Where("token_id = ?", tokenID)
 	}
-	if ip != "" {
-		tx = tx.Where("ip = ?", ip)
-	}
-	if mode != 0 {
-		tx = tx.Where("mode = ?", mode)
-	}
-	if endpoint != "" {
-		tx = tx.Where("endpoint = ?", endpoint)
-	}
 
 	// Handle keyword search for zero value fields
 	if keyword != "" {
 		var conditions []string
 		var values []interface{}
 
+		if requestID == "" {
+			conditions = append(conditions, "request_id = ?")
+			values = append(values, keyword)
+		}
 		if group == "" {
 			conditions = append(conditions, "group_id = ?")
 			values = append(values, keyword)
@@ -802,20 +780,12 @@ func buildSearchLogsQuery(
 			conditions = append(conditions, "token_name = ?")
 			values = append(values, keyword)
 		}
-		if requestID == "" {
-			conditions = append(conditions, "request_id = ?")
-			values = append(values, keyword)
-		}
 
 		// if num := String2Int(keyword); num != 0 {
 		// 	if channelID == 0 {
 		// 		conditions = append(conditions, "channel_id = ?")
 		// 		values = append(values, num)
 		// 	}
-		// 	if mode != 0 {
-		// 		conditions = append(conditions, "mode = ?")
-		// 		values = append(values, num)
-		// 	}
 		// }
 
 		// if ip != "" {
@@ -823,15 +793,6 @@ func buildSearchLogsQuery(
 		// 	values = append(values, ip)
 		// }
 
-		// if endpoint == "" {
-		// 	if common.UsingPostgreSQL {
-		// 		conditions = append(conditions, "endpoint ILIKE ?")
-		// 	} else {
-		// 		conditions = append(conditions, "endpoint LIKE ?")
-		// 	}
-		// 	values = append(values, "%"+keyword+"%")
-		// }
-
 		// slow query
 		// if common.UsingPostgreSQL {
 		// 	conditions = append(conditions, "content ILIKE ?")
@@ -851,7 +812,6 @@ func buildSearchLogsQuery(
 func searchLogs(
 	group string,
 	keyword string,
-	endpoint string,
 	requestID string,
 	tokenID int,
 	tokenName string,
@@ -860,7 +820,6 @@ func searchLogs(
 	endTimestamp time.Time,
 	channelID int,
 	order string,
-	mode int,
 	codeType CodeType,
 	withBody bool,
 	ip string,
@@ -877,7 +836,6 @@ func searchLogs(
 		return buildSearchLogsQuery(
 			group,
 			keyword,
-			endpoint,
 			requestID,
 			tokenID,
 			tokenName,
@@ -885,7 +843,6 @@ func searchLogs(
 			startTimestamp,
 			endTimestamp,
 			channelID,
-			mode,
 			codeType,
 			ip,
 			resultOnly,
@@ -896,7 +853,6 @@ func searchLogs(
 		query := buildSearchLogsQuery(
 			group,
 			keyword,
-			endpoint,
 			requestID,
 			tokenID,
 			tokenName,
@@ -904,7 +860,6 @@ func searchLogs(
 			startTimestamp,
 			endTimestamp,
 			channelID,
-			mode,
 			codeType,
 			ip,
 			resultOnly,
@@ -936,7 +891,6 @@ func searchLogs(
 func SearchLogs(
 	group string,
 	keyword string,
-	endpoint string,
 	requestID string,
 	tokenID int,
 	tokenName string,
@@ -945,7 +899,6 @@ func SearchLogs(
 	endTimestamp time.Time,
 	channelID int,
 	order string,
-	mode int,
 	codeType CodeType,
 	withBody bool,
 	ip string,
@@ -961,7 +914,7 @@ func SearchLogs(
 
 	g.Go(func() error {
 		var err error
-		total, logs, err = searchLogs(group, keyword, endpoint, requestID, tokenID, tokenName, modelName, startTimestamp, endTimestamp, channelID, order, mode, codeType, withBody, ip, page, perPage, resultOnly)
+		total, logs, err = searchLogs(group, keyword, requestID, tokenID, tokenName, modelName, startTimestamp, endTimestamp, channelID, order, codeType, withBody, ip, page, perPage, resultOnly)
 		return err
 	})
 
@@ -987,7 +940,6 @@ func SearchLogs(
 func SearchGroupLogs(
 	group string,
 	keyword string,
-	endpoint string,
 	requestID string,
 	tokenID int,
 	tokenName string,
@@ -996,7 +948,6 @@ func SearchGroupLogs(
 	endTimestamp time.Time,
 	channelID int,
 	order string,
-	mode int,
 	codeType CodeType,
 	withBody bool,
 	ip string,
@@ -1019,7 +970,7 @@ func SearchGroupLogs(
 
 	g.Go(func() error {
 		var err error
-		total, logs, err = searchLogs(group, keyword, endpoint, requestID, tokenID, tokenName, modelName, startTimestamp, endTimestamp, channelID, order, mode, codeType, withBody, ip, page, perPage, resultOnly)
+		total, logs, err = searchLogs(group, keyword, requestID, tokenID, tokenName, modelName, startTimestamp, endTimestamp, channelID, order, codeType, withBody, ip, page, perPage, resultOnly)
 		return err
 	})