server_traffic_status_filter_by_set_key

The 'server_traffic_status_filter_by_set_key' directive filters server traffic status data based on specific keys.

Syntaxserver_traffic_status_filter_by_set_key key1 [key2];
Defaultnone
Contextstream, stream server
Arguments1-2

Description

The 'server_traffic_status_filter_by_set_key' directive in the NGINX stream server traffic status module allows users to filter traffic status data by one or more set keys. This directive can take one or two arguments, which define the keys used for filtering. When applied, it processes incoming traffic metrics and applies the provided keys to the metrics, thus allowing for a more granular inspection of streaming traffic based on specific criteria. By doing this, it helps in organizing and monitoring streaming traffic more effectively, especially in setups with multiple streams or servers.

The arguments provided can vary in nature, typically representing identifiers or criteria relevant to how the streaming traffic is analyzed. The directive utilizes internal structures and sorting mechanisms to handle the uniqueness of the keys and compile the necessary filtering logic. This filtering process entails the hashing of key values to ensure efficient lookups and comparisons during traffic status analyses, improving performance and accuracy in traffic reporting.

This directive is particularly useful in environments where traffic patterns are closely monitored for performance tuning, automated scaling, or troubleshooting of network issues through detailed insights.

Config Example

stream {
    server {
        listen 12345;
        server_traffic_status_zone;
        server_traffic_status_filter_by_set_key my_filter_key;
    }
}

Ensure that the arguments provided for filtering are correctly set to match traffic metrics; otherwise, no data will be displayed.

Remember that if multiple filters are set, they should not conflict with each other, as each key should accurately represent a unique metric.

← Back to all directives