eCDN Logpush Filter
A successful response returns 201.
The following table shows the supported comparison operators along with example values.
To add filters, provide the filter criteria in the form of escaped JSON strings with the format
{\"where\":{\"key"\:\"<field>\",\"operator\":\"<comparison_operator>\",\"value\":\"<value>\"}}
.
The \“Key”\
field value must correspond to one of the available fields listed in eCDN Logpush Log Field.
Name | Operator Notation | Supported Field Types | Example |
---|---|---|---|
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]}} |
- Filters can be connected using
AND, OR
logical operators. - Logical operators can be nested.
Here are some examples of how the logical operators can be implemented. X, Y, and Z are used to represent filter criteria:
- 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}]}}
In this example, the eCDN logpush job sends the logs to the S3 bucket only if the log has ClientRequestPath that contains “/example-path”
and EdgeResponseStatus includes 502, 503, and 504.