Skip to content

Server Rule Hits Metrics.

POST
/api/data/namespaces/{namespace}/wafs/metrics/server/rule_hits
curl --request POST \
--url https://example-corp.console.ves.volterra.io/api/v1/api/production/us-east-1/namespaces/default/api/data/namespaces/example/wafs/metrics/server/rule_hits \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "end_time": "example", "group_by": [ "NAMESPACE" ], "label_filter": [ { "label": "NAMESPACE", "op": "EQ", "value": "example" } ], "namespace": "example", "range": "example", "start_time": "example", "step": "example" }'

GET number of rule hits per server for a given namespace. The rule hits counter can be aggregated based on one or more labels listed here. NAMESPACE, APP_TYPE, VIRTUAL_HOST, SITE, SERVICE, INSTANCE, WAF_INSTANCE_ID, RULE_ID, RULE_SEVERITY, RULE_TAG.

Examples of this operation.

namespace
required
string

Namespace

namespace is used to scope the WAF rule hits for the given namespace.

Media typeapplication/json
RuleHitsCountRequest

Request to GET number of rule hits per client/server for a given namespace.

object
end_time
End time

End time of metric collection from which data will be considered. Format: unix_timestamp|RFC 3339

Optional: If not specified, then the end_time will be evaluated to start_time+10m If start_time is not specified, then the end_time will be evaluated to

string
<= 1024 characters
group_by
Group by

Aggregate data by one of more labels listed here. NAMESPACE, APP_TYPE, VIRTUAL_HOST, SITE, SERVICE, INSTANCE, WAF_INSTANCE_ID, RULE_ID, RULE_SEVERITY, RULE_TAG.

Optional: If not specified, then the rule hits are aggregated/grouped by VIRTUAL_HOST.

Array<string>
Allowed values: NAMESPACE APP_TYPE VIRTUAL_HOST SITE SERVICE INSTANCE WAF_INSTANCE_ID RULE_ID RULE_SEVERITY RULE_TAG WAF_MODE BOT_TYPE BOT_NAME
label_filter
Label Filter

List of label filter expressions of the form “label” Op “value”. Response will only contain data that matches all the conditions specified in the label_filter. One or more of the following labels can be specified in the label_filter. APP_TYPE, VIRTUAL_HOST, SITE, SERVICE, INSTANCE, WAF_INSTANCE_ID, RULE_ID, RULE_SEVERITY, RULE_TAG.

Optional: If not specified, then the metrics will be filtered only based on the namespace in the request.

Array<object>

Label based filtering of WAF metrics.

WAF metrics are tagged with labels mentioned in MetricLabel. Metric label filter can be specified to query specific metrics based on label match.

object
label
string
default: NAMESPACE
Allowed values: NAMESPACE APP_TYPE VIRTUAL_HOST SITE SERVICE INSTANCE WAF_INSTANCE_ID RULE_ID RULE_SEVERITY RULE_TAG WAF_MODE BOT_TYPE BOT_NAME
op
string
default: EQ
Allowed values: EQ NEQ
value
Value

Value to be compared with.

string
>= 3 characters <= 1024 characters
namespace
Namespace

Namespace is used to scope the WAF rule hits for the given namespace.

string
>= 6 characters <= 1024 characters
range
Range

Range decides how far to go back in time to fetch values for each step. For example, if the range is 5m, then for step t1, query will be evaluated for t1-5m and for t2, query will be evaluated for t2-5m and so on. Format: [0-9][smhd], where s - seconds, m - minutes, h - hours, d - days

Note: For non-timeseries query, i.e., for step=end_time-start_time, range should be set to end_time-start_time

Optional: If not specified, range is set to 5m.

string
<= 1024 characters
start_time
Start time

Start time of metric collection from which data will be considered. Format: unix_timestamp|RFC 3339

Optional: If not specified, then the start_time will be evaluated to end_time-10m If end_time is not specified, then the start_time will be evaluated to -10m.

string
<= 1024 characters
step
Step

Step is the resolution width, which determines the number of the data points [x-axis (time)] to be returned in the response. The timestamps in the response will be t1=start_time, t2=t1+step, … Tn=tn-1+step, where tn <= end_time. Format: [0-9][smhd], where s - seconds, m - minutes, h - hours, d - days

Optional: If not specified, then step size is evaluated to <end_time - start_time>

string
<= 1024 characters

A successful response.

Media typeapplication/json
RuleHitsCountResponse

Number of rule hits for each unique combination of group_by labels in the RuleHitsCountRequest.

object
data
Rule hits counter

List of rule hits counter data.

Array<object>
Rule Hits Counter

RuleHitsCounter contains the timeseries data of rule hits counter.

object
id
object
app_type
AppType

AppType configured on the virtual_host under which this WAF instance is running.

string
<= 1024 characters
bot_name
Bot Name

Name of the Bot associated with the WAF rule.

string
<= 1024 characters
bot_type
Bot Type

Type of Bot (crawler, scanner, script)

string
<= 1024 characters
instance
Instance

Region from which the client’s accesses caused WAF metrics to be generated.

string
<= 1024 characters
namespace
Namespace

Namespace in which this WAF instance is running.

string
>= 6 characters <= 1024 characters
rule_id
Rule ID

RuleID of the rule that was hit to cause this metric to be generated.

string
<= 1024 characters
rule_severity
Rule Severity

Rule severity of the rule that was hit to cause this metric to be generated.

string
<= 1024 characters
rule_tag
Rule Tag

Rule tag of the rule that was hit to cause this metric to be generated.

string
<= 1024 characters
service
Service

Service for which this WAF instance is reporting the metrics.

string
<= 1024 characters
site
Site

Site from which this WAF instance is reporting the metrics.

string
<= 1024 characters
virtual_host
Virtual Host

Virtual host under which this WAF instance is running.

string
<= 1024 characters
waf_instance_id
WAF Instance ID

WAF instance ID.

string
<= 1024 characters
metric
Metric Values

List of metric values.

Array<object>
Metric Value

Metric data contains timestamp and the value.

object
timestamp
Timestamp

Timestamp

number format: double
trend_value
object
description
Description

Description of the method used to calculate trend.

string
>= 21 characters <= 1024 characters
previous_value
Previous Value

Configuration parameter for previous value

string
<= 1024 characters
sentiment
string
default: TREND_SENTIMENT_NONE
Allowed values: TREND_SENTIMENT_NONE TREND_SENTIMENT_POSITIVE TREND_SENTIMENT_NEGATIVE
value
Value

Configuration parameter for value

string
>= 3 characters <= 1024 characters
value
Value

Configuration parameter for value

string
>= 3 characters <= 1024 characters
step
step

Actual step size used in the response. It could be higher than the requested step due to metric rollups and the query duration. Format: [0-9][smhd], where s - seconds, m - minutes, h - hours, d - days.

string
<= 1024 characters
Example
{
"data": [
{
"metric": [
{
"trend_value": {
"sentiment": "TREND_SENTIMENT_NONE"
}
}
]
}
]
}

Returned when operation is not authorized.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when there is no permission to access resource.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when resource is not found.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when operation on resource is conflicting with current value.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when operation has been rejected as it is happening too frequently.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when server encountered an error in processing API.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when service is unavailable temporarily.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when server timed out processing request.

Media typeapplication/json
string format: string
Examplegenerated
example