younifyd
Menu

Create Logpush Job

Create Logpush job.

POST/organizations/{organizationId}/zones/{zoneId}/logpush/jobs

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Create Logpush Job action (under Zones (Data API)).
  3. Fill in the fields below, then reference the result from later steps as {{createLogpushJob.response.data}}.

Request

Path parameters

zoneIdstringrequired
organizationIdstringrequired

An identifier for the organization the request is being made by

Request body

Enter the body as JSON in the step's Body field.

destinationPathstringrequired

Uniquely identifies s3 bucket for logs. Additional configuration parameters like region can be included. The string {DATE} in the URL path to separate logs into daily subdirectories; for example `s3://customer-bucket/logs/{DATE}?region=us-east-1&sse=AES256` The name of the directory will be replaced with the date in YYYYMMDD format (e.g. 20220215) when the logs are stored.

namestringrequired

Logpush job name; the name cannot be changed after the job is created.

filterstring

Filter provides a way to customize which logs you want to receive. Filters are added as escaped JSON strings formatted. Default will include all logs.

logFieldsarray<string>required

List of log fields. Depending on the type of log, the list of fields that you would like to see in the logs may vary.

ownershipChallengeTokenstring

Ownership token to proves the ownership of the destinationPath.

enabledboolean

Enable logpush job while creating it.

logTypestringrequired

Type of logs. Available log types are `http_requests`, `firewall_events`, and `page_shield_events`.

One ofhttp_requestsfirewall_eventspage_shield_events

json
{
  "destinationPath": "s3://customer-bucket/site-name/{DATE}?region=us-east-1&sse=AES256",
  "name": "my-logpush-job",
  "logFields": [
    "ClientRequestBytes",
    "ClientRequestHost",
    "ClientRequestMethod"
  ],
  "logType": "http_requests",
  "filter": "{\"where\":{\"key\":\"ClientRequestPath\",\"operator\":\"contains\",\"value\":\"/example-path\"}}",
  "ownershipChallengeToken": "abc00000000000000000000",
  "enabled": true
}

Response

Returns 201 with an object. Read it in later steps with {{createLogpushJob.response.data.<field>}}.

dataobject

Logpush job response

jobIdinteger

Unique ID of the job.

namestring

Logpush job name; the name cannot be changed after the job is created.

logTypestring

Type of logs; available log types are `http_requests`, `firewall_events`, and `page_shield_events`.

One ofhttp_requestsfirewall_eventspage_shield_events

filterstring

Filter provides a way to customize which logs you want to receive. Filters are added as escaped JSON strings formatted. If the filter is not displayed, it indicates that all logs should be included.

logFieldsarray<string>

List of log fields. Depending on the type of log, the list of fields that you would like to see in the logs may vary.

destinationPathstring

Uniquely identifies s3 bucket for logs.

enabledboolean

Flag that indicates if the job is enabled or disabled.

lastCompletestring (date-time)

The last time that the log has been successfully transmitted to the destination.

lastErrorstring (date-time)

The last time the job failed. If empty, the job has either never failed or has run successfully at least once since the last failure.

errorMessagestring

Provide details for the last failure message. If this field is empty, it indicates that the job successfully transmitted logs to the destination.

createdOnstring (date-time)

Job creation time.

json
{
  "data": {
    "jobId": 123456,
    "name": "my-logpush-job",
    "logType": "http_requests",
    "filter": "{\"where\":{\"key\":\"ClientRequestPath\",\"operator\":\"contains\",\"value\":\"/example-path\"}}",
    "logFields": [
      "ClientRequestBytes",
      "ClientRequestHost",
      "ClientRequestMethod"
    ],
    "destinationPath": "s3://customer-bucket/site-name/{DATE}?region=us-east-1&sse=AES256",
    "enabled": false,
    "lastComplete": "2023-01-02T00:00:00Z",
    "lastError": "2023-01-01T10:00:00Z",
    "errorMessage": "No permissions to write to destination bucket",
    "createdOn": "2023-01-01T00:00:27Z"
  }
}

Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.