rtmp_stat_format

The `rtmp_stat_format` directive specifies the format for statistics output of RTMP streams in NGINX.

Syntaxrtmp_stat_format format_string;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The rtmp_stat_format directive is used within the NGINX RTMP module to define the output format for the streaming statistics. When this directive is configured, it changes how statistics about the RTMP streams are presented, allowing administrators to tailor information display according to their needs. The configuration is generally placed at the 'http', 'server', or 'location' context levels, allowing for flexibility in the application of the directive depending on the server's architecture and requirements.

The argument provided to the rtmp_stat_format directive defines the specific format string, which can include various placeholders that are replaced with actual data values during runtime. This can include identifiers for statistics like the stream name, bytes sent, viewer count, and other relevant stream metrics. Custom formatting can enhance monitoring capabilities and provide more relevant data for analytics tools or logging purposes.

As with other directives, the configuration must be set properly to ensure accurate collection and output of streaming statistics. This directive aids in managing and analyzing RTMP streams by making data presentation more user-friendly and structured, which is essential in a media streaming context where understanding user engagement and stream performance is critical.

Config Example

rtmp_stat_format "{name} {clients} {bytes} {time}";

Ensure the format string is correctly specified; incorrect syntax can lead to errors in output.

Be aware of the context where rtmp_stat_format is placed; it must be in http, server, or location blocks.

If using custom placeholders, ensure they are supported by the module to avoid unexpected output.

← Back to all directives