# Edge ## List Instant Logs jobs `client.logpush.edge.get(EdgeGetParamsparams, RequestOptionsoptions?): SinglePage` **get** `/zones/{zone_id}/logpush/edge/jobs` Lists Instant Logs jobs for a zone. ### Parameters - `params: EdgeGetParams` - `zone_id: string` Identifier. ### Returns - `InstantLogpushJob | null` - `destination_conf?: 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?: number` 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. - `session_id?: string` Unique session id of the job. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const instantLogpushJob of client.logpush.edge.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(instantLogpushJob.session_id); } ``` #### 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" } ] } ``` ## Create Instant Logs job `client.logpush.edge.create(EdgeCreateParamsparams, RequestOptionsoptions?): InstantLogpushJob | null` **post** `/zones/{zone_id}/logpush/edge/jobs` Creates a new Instant Logs job for a zone. ### Parameters - `params: EdgeCreateParams` - `zone_id: string` Path param: Identifier. - `fields?: string` Body param: Comma-separated list of fields. - `filter?: string` Body param: Filters to drill down into specific events. - `sample?: number` 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 - `InstantLogpushJob | null` - `destination_conf?: 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?: number` 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. - `session_id?: string` Unique session id of the job. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const instantLogpushJob = await client.logpush.edge.create({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(instantLogpushJob.session_id); ``` #### 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" } } ``` ## Domain Types ### Instant Logpush Job - `InstantLogpushJob` - `destination_conf?: 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?: number` 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. - `session_id?: string` Unique session id of the job.