소스 검색

修改cloudflare推送日志的字段

ChenHaolong 1 년 전
부모
커밋
8bb6a5b5bb
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      server/LogPushCloudflareServer.go

+ 7 - 4
server/LogPushCloudflareServer.go

@@ -62,10 +62,13 @@ func (s *LogPushCloudflareServer) CreateLogPushJobByZoneId(ctx context.Context,
 	ctxAPI := context.Background()
 
 	job := cloudflare.LogpushJob{
-		Dataset:            requestCloudflare.GetDataSet(),
-		DestinationConf:    requestCloudflare.GetDestinationConf(),
-		Enabled:            true,
-		Frequency:          "high",
+		Dataset:         requestCloudflare.GetDataSet(),
+		DestinationConf: requestCloudflare.GetDestinationConf(),
+		Enabled:         true,
+		Frequency:       "low",
+		LogpullOptions: "fields=RayID,ZoneName," +
+			"ClientCountry,ClientIP,ClientRequestBytes,ClientRequestHost,ClientRequestPath," +
+			"EdgeResponseStatus,EdgeResponseBytes,EdgeStartTimestamp&timestamps=rfc3339,EdgeEndTimestamp&timestamps=rfc3339",
 		OwnershipChallenge: requestCloudflare.GetOwnershipChallenge(),
 	}
 	result, err := api.CreateZoneLogpushJob(ctxAPI, requestCloudflare.GetZoneId(), job)