eCDN Logpush フィルター
成功したレスポンスは 201 を返します。
次の表に、サポートされている比較演算子と、値の例を示します。
フィルターを追加するには、次の形式のエスケープされた JSON 文字列の形式でフィルター条件を指定します:
{\"where\":{\"key"\:\"<field>\",\"operator\":\"<comparison_operator>\",\"value\":\"<value>\"}}。
\“Key”\ フィールド値は、eCDN Logpush ログフィールド にリストされている利用可能なフィールドの 1 つに対応する必要があります。
| 名前 | 演算子の表記法 | サポートされているフィールドタイプ | 例 |
|---|---|---|---|
| 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 はフィルター条件を表すために使用されます。
- X AND Y AND Z -
{"where":{"and":[{X},{Y},{Z}]}} - X OR Y OR Z -
{"where":{"or":[{X},{Y},{Z}]}} - X AND (Y OR Z) -
{"where":{"and":[{X}, {"or":[{Y},{Z}]}]}} - (X AND Y) OR Z -
{"where":{"or":[{"and": [{X},{Y}]},{Z}]}}
この例では、ログに “/example-path” が含まれる ClientRequestPath があり、かつ EdgeResponseStatus に 502、503、および 504 が含まれる場合のみ、eCDN logpush ジョブはログを S3 バケットに送信します。