## Create Instant Logs job `client.Logpush.Edge.New(ctx, params) (*InstantLogpushJob, error)` **post** `/zones/{zone_id}/logpush/edge/jobs` Creates a new Instant Logs job for a zone. ### Parameters - `params EdgeNewParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Fields param.Field[string]` Body param: Comma-separated list of fields. - `Filter param.Field[string]` Body param: Filters to drill down into specific events. - `Sample param.Field[int64]` Body param: The sample parameter is the sample rate of the records set by the client: "sample": 1 is 100% of records "sample": 10 is 10% and so on. ### Returns - `type InstantLogpushJob struct{…}` - `DestinationConf string` Unique WebSocket address that will receive messages from Cloudflare’s edge. - `Fields string` Comma-separated list of fields. - `Filter string` Filters to drill down into specific events. - `Sample int64` The sample parameter is the sample rate of the records set by the client: "sample": 1 is 100% of records "sample": 10 is 10% and so on. - `SessionID string` Unique session id of the job. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/logpush" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) instantLogpushJob, err := client.Logpush.Edge.New(context.TODO(), logpush.EdgeNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", instantLogpushJob.SessionID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "destination_conf": "wss://logs.cloudflare.com/instant-logs/ws/sessions/99d471b1ca3c23cc8e30b6acec5db987", "fields": "ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID", "filter": "{\"where\":{\"and\":[{\"key\":\"ClientCountry\",\"operator\":\"neq\",\"value\":\"ca\"}]}}", "sample": 1, "session_id": "99d471b1ca3c23cc8e30b6acec5db987" } } ```