この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
1curl "https://{shortcode}.api.commercecloud.salesforce.com/cdn/zones/v1/organizations/f_ecom_bcxj_prd/zones/{zoneId}/logpush/jobs"
2--request 'POST' \
3--header 'Authorization: Bearer <access_token>' \
4--header 'Content-Type: application/json' \
5--data-raw `{
6 "name": "ExampleLogPushJob",
7 "destinationPath": "s3://example-bucket/log?region=us-east-1",
8 "logType": "http_requests",
9 "ownershipChallengeToken": "Put your ownership challenge token here",
10 "filter": "{\"where\":{\"key\":\"ClientRequestPath\",\"operator\":\"contains\",\"value\":\"/example-path\"}}"
11 "logFields": [
12 "CacheCacheStatus",
13 "CacheResponseBytes",
14 "ClientRequestPath",
15 "ClientRequestBytes",
16 "ClientRequestHost",
17 "ClientRequestUserAgent",
18 "EdgeResponseStatus",
19 "EdgeResponseBytes",
20 "EdgeStartTimestamp",
21 "EdgeTimeToFirstByteMs"
22 ]
23}`成功した場合は、201 が返されます。
1{
2 "data": {
3 "jobId": 213543,
4 "name": "ExampleLogPushJob",
5 "logType": "http_requests",
6 "logFields": [
7 "CacheCacheStatus",
8 "CacheResponseBytes",
9 "ClientRequestPath",
10 "ClientRequestBytes",
11 "ClientRequestHost",
12 "ClientRequestUserAgent",
13 "EdgeResponseStatus",
14 "EdgeResponseBytes",
15 "EdgeStartTimestamp",
16 "EdgeTimeToFirstByteMs"
17 ],
18 "filter": "{\"where\":{\"key\":\"ClientRequestPath\",\"operator\":\"contains\",\"value\":\"/example-path\"}}",
19 "destinationPath": "s3://example-bucket/log?region=us-east-1",
20 "enabled": false,
21 "createdOn": "2023-04-18T17:18:43Z"
22 }
23}次の表に、サポートされている比較演算子と、値の例を示します。
フィルターを追加するには、次の形式のエスケープされた JSON 文字列の形式でフィルター条件を指定します:
{\"where\":{\"key"\:\"<field>\",\"operator\":\"<comparison_operator>\",\"value\":\"<value>\"}}。
\“Key”\ フィールド値は、eCDN Logpush ログフィールド にリストされている利用可能なフィールドの 1 つに対応する必要があります。
Note
| 名前 | 演算子の表記法 | サポートされているフィールドタイプ | 例 |
|---|---|---|---|
| Equal (等しい) | eq | String, Int, Bool | {\“where\":{\"key\":\"ClientRequestHost\",\"operator\":\"eq\",\"value\":\"example.com\"}} |
| Not equal (等しくない) | !eq | String, Int, Bool | {\“where\":{\"key\":\"ClientCountry\",\"operator\":\"!eq\",\"value\":\"ca\"}} |
| Less than (より小さい) | lt | Int | {\“where\":{\"key\":\"BotScore\",\"operator\":\"lt\",\"value\":\"30\"}} |
| Less than or equal (以下) | leq | Int | {\“where\":{\"key\":\"BotScore\",\"operator\":\"leq\",\"value\":\"30\"}} |
| Greater than (より大きい) | gt | Int | {\“where\":{\"key\":\"BotScore\",\"operator\":\"gt\",\"value\":\"30\"}} |
| Greater than or equal (以上) | geq | Int | {\“where\":{\"key\":\"BotScore\",\"operator\":\"geq\",\"value\":\"30\"}} |
| Starts with (次の値で始まる) | startsWith | String | {\“where\":{\"key\":\"ClientRequestPath\",\"operator\":\"startsWith\",\"value\":\"/foo\"}} |
| Ends with (次の値で終わる) | endsWith | String | {\“where\":{\"key\":\"ClientRequestPath\",\"operator\":\"endsWith\",\"value\":\"/foo\"}} |
| Does not start with (次の値で始まらない) | startsWith | String | {\“where\":{\"key\":\"ClientRequestPath\",\"operator\":\"!startsWith\",\"value\":\"/foo\"}} |
| Does not end with (次の値で終わらない) | !endsWith | String | {\“where\":{\"key\":\"ClientRequestPath\",\"operator\":\"!endsWith\",\"value\":\"/foo\"}} |
| Contains (含む) | contains | String, Bool | {\“where\":{\"key\":\"ClientRequestPath\",\"operator\":\"contains\",\"value\":\"/static\"}} |
| Does not contain (含まない) | contains | String, Bool | {\“where\":{\"key\":\"ClientRequestPath\",\"operator\":\"!contains\",\"value\":\"/static\"}} |
| Value is in a set of values (値は値のセット内にあり) | in | String, Int, Array | {\“where\":{\"key\":\"EdgeResponseStatus\",\"operator\":\"in\",\"value\":[200,201]}} |
| Value is not in a set of values (値は値のセット内になし) | in | String, Int, Array | {\“where\":{\"key\":\"EdgeResponseStatus\",\"operator\":\"!in\",\"value\":[200,201]}} |
AND, OR 論理演算子を使用して接続できます。ここで、論理演算子を実装する方法の例をいくつか示します。X、Y、Z はフィルター条件を表すために使用されます。
{"where":{"and":[{X},{Y},{Z}]}}{"where":{"or":[{X},{Y},{Z}]}}{"where":{"and":[{X}, {"or":[{Y},{Z}]}]}}{"where":{"or":[{"and": [{X},{Y}]},{Z}]}}この例では、ログに “/example-path” が含まれる ClientRequestPath があり、かつ EdgeResponseStatus に 502、503、および 504 が含まれる場合のみ、eCDN logpush ジョブはログを S3 バケットに送信します。
1curl "https://{shortcode}.api.commercecloud.salesforce.com/cdn/zones/v1/organizations/f_ecom_bcxj_prd/zones/{zoneId}/logpush/jobs`
2--request 'POST' \
3--header 'Authorization: Bearer <access_token>' \
4--header 'Content-Type: application/json' \
5--data-raw `{
6 "name": "ExampleLogPushJob",
7 "destinationPath": "s3://example-bucket/log?region=us-east-1",
8 "logType": "http_requests",
9 "ownershipChallengeToken": "Put your ownership challenge token here",
10 "filter": "{\"where\":{\"and\":[{\"key\":\"ClientRequestPath\",\"operator\":\"contains\",\"value\":\"/example-path\"}, {\"key\":\"EdgeResponseStatus\",\"operator\":\"in\",\"value\":[502, 503, 504]}]}}",
11 "logFields": [
12 "CacheCacheStatus",
13 "CacheResponseBytes",
14 "ClientRequestPath",
15 "ClientRequestBytes",
16 "ClientRequestHost",
17 "ClientRequestUserAgent",
18 "EdgeResponseStatus",
19 "EdgeResponseBytes",
20 "EdgeStartTimestamp",
21 "EdgeTimeToFirstByteMs"
22 ]
23}`