How to Setup Wowza Media Server for CasterStats

Wowza Logging Setup

To use the reporting capabilities of CasterStats Reporter, you need to parse streaming server log files.

Reporter Image

Wowza logging can be configured in the file log4j.properties located in [install-dir]/conf/

To improve performance, we suggest you use CasterStats appender (see below) as that is lighter and also contains everything needed. To enable it add CasterStats to the list of appenders in the first line of the configuration file and copy and paste the following code:

log4j.rootCategory=INFO, stdout, serverAccess, serverError, casterStats

If you don’t have the appender configuration, here is how it goes:

[COLOR="green"]# Statistics appender[/COLOR] (to use this appender add "casterStats" to the list of appenders in the first line of this file)
[COLOR="green"]log4j.appender.casterStats=org.apache.log4j.DailyRollingFileAppender
log4j.appender.casterStats.DatePattern='.'yyyy-MM-dd
log4j.appender.casterStats.File=${com.wowza.wms.ConfigHome}/logs/wowzamediaserver_casterstats.log
log4j.appender.casterStats.layout=com.wowza.wms.logging.ECLFPatternLayout
log4j.appender.casterStats.layout.Fields=x-severity,x-category,x-event;date,time,c-client-id,c-ip,c-port,cs-bytes,sc-bytes,x-duration,x-sname,x-stream-id,x-spos,sc-stream-bytes,cs-stream-bytes,x-file-size,x-file-length,x-vhost,x-app,x-appinst,x-ctx,x-comment
log4j.appender.casterStats.layout.OutputHeader=true
log4j.appender.casterStats.layout.QuoteFields=false
log4j.appender.casterStats.layout.Delimeter=tab
log4j.appender.casterStats.layout.CategoryInclude=session,stream
log4j.appender.casterStats.layout.EventExclude=comment[/COLOR]

In CasterStats® configuration, simply point to wowzamediaserver_casterstats.log or specify the wildcard wowzamediaserver_stats*.log.

We also highly recommend that you use a separate log file for each application you want to analyze.

Wowza Real-time Stats Providers Setup

CasterStats® Dashboard is compatible with the Wowza HTTPProviders. They provide you with a web based interface to access real-time stats. CasterStats® uses them to visualize your audience in its Dashboard.

Dashboard Image

CasterStats® uses two of the providers available from Wowza straight out of the box:

HTTPServerInfoXML (com.wowza.wms.http.HTTPServerInfoXML) & HTTPConnectionInfo (com.wowza.wms.http.HTTPConnectionInfo).

They are already configured within the default installation. All you have to do is enable password protection by editing the file located in [install-dir]/conf/admin.password.

In addition here is a link to a custom HTTP provider which supports all client types (RTMP, RTP and HTTP) and removes the current limitations on accurate client counts.

This HTTP provider was created by Andrew Kennedy from shamrock.org.uk and the link takes you to their page where you can download a pdf about the provider and the XMLConnectionCounts.jar file.

CasterStats® Configuration

Now you have configured Wowza, you must add the stream in the CasterStats® configuration. Wowza has some specific details that you need to be aware of.

In addition to the arbitrary name you can specify in the General Settings box, be sure to set correct values in Technical Settings box:

  • Select WowzaMediaServer in Type

  • Be sure to specify the host or IP of your wowza server

  • Port for Wowza HTTP Providers is 8086 by default

  • Mount should contain the path to your application instance or stream (see examples below)

  • (to get very detailed reports):

    [B]/_defaultVHost_/applicationname/_definst_/mystream.stream[/B]
    
  • (will take all data within that instance):

    [B]/_defaultVHost_/applicationname/_definst_[/B]
    
  • (same effect as point a):

    [B] rtmp://myserver/applicationname/mystream.stream[/B]
    
  • Be sure to set up the username of the HTTP Provider

  • And the correct password

    Set Up Image 1

    If you want to retrieve logs located on a remote server by FTP, point to the log file you specified in the log4j.properties file in the first step of this article.

    Set Up Image 2

    Of course you can specify any local or network path with wildcards in the Sources tab.

    Set Up Image 3

    Check our knowledgebase article on Wowza Media Server SetUp for any updates

The screenshots look great. I especially like the geolocation info.

Yes, this is configured in /conf/log4j.properties file. You will find a section that is commented out that you just have to uncomment and restart Wowza to enable

Richard

It is:

 
_defaultVHost_

Richard

You should also try Casterstats support. I don’t know the answer to this.

Richard

I see that, and it doesn’t seem right. I think the Casterstats folks wrote that up. I would contact them.

Richard

These .stream files are placed in the content folder.

Richard

I have used Sawmill successfully:

https://www.wowza.com/docs/how-to-use-sawmill-to-analyze-wowza-media-server-logs

Richard

I don’t think Sawmill does real-time stats, and not sure about reports by email, etc. It was easy to get it to work and has streaming stats.

Take a look at the built-in HTTPProviders and JConsole graphs for real-time data:

https://www.wowza.com/docs/how-to-monitor-server-connections-load-and-application-statistics

https://www.wowza.com/docs/how-to-graph-individual-values-ex-concurrent-connections-to-the-server

Richard

Steve,

Hopefully CasterStats will follow-up here. I don’t know the answer. They may have direct support.

Richard

Hallo Randall, If you want to see more than just the screenshots, you can try CasterStats on a 14 day free trial. Download from www.casterstats.com/downloads.php. Let us know if you need help with anything. Hazel

The screenshots look great. I especially like the geolocation info.

for users : pay attention when copy and paste the code, there are an error (space in many line)

stefano

Hi,

i mean the code for casterstats logs,

so, now appear correct .

authorleon, sorry but i not understand fine what you mean, this code is for generate wowzamediaserver_casterstats.log

what you want to do ?

stefano

authorleon,

put in the Mount / Publishing Point / Filter :

/defaultVHost/applicationname/definst

i use casterstats and Sawmill also, and both working properly .

Does it have real time stats? NO

Does it have a web interface? YES

Produce report and send them via email (pdf) YES

stefano

Hi authorleon,

look my configuration :

this working properly .

so, using http are you able to see connection counts details ? ( HTTPServerInfoXML & HTTPConnectionInfo )

elhal82,

why not working properly using /defaultVHost/applicationname/definst/stream.sdp ?

what exactly happens ?

steve

Hi, what do you mean by “We also highly recommend that you use a separate log file for each application you want to analyze.” Adn how to acheive this?

Is this related to this part of the log4j.properties file?

"

Below are logging definitions for dynamic log file generation on a per application basis.

To use these logging appender, uncomment each of the lines below. It will generate log files

using the following directory/file structure:

[install-dir]/logs/[vhost]/[application]/wowzamediaserver_access.log

[install-dir]/logs/[vhost]/[application]/wowzamediaserver_error.log

[install-dir]/logs/[vhost]/[application]/wowzamediaserver_stats.log

"

Thanks.

Ok, supposing that my WowzaMediaServer is installed with the default setup:

[install-dir] will be: usr/local/WowzaMediaServer

[application] will be the name of my application for example: live

But what is the value of [vhost] for a default installation of Wowza?

for users : pay attention when copy and paste the code, there are an error (space in many line)

stefano

Hi…

Where it says Mount/Publishing Pint / FIlter

I have put: http://xxx.xxx.xxx.xxx/logs/wowzamediaserver_access.log

But it does not work. I am connected and it shows the status as up.

I am using windows.

Can someone please help me.

Hi,

i mean the code for casterstats logs,

so, now appear correct .

authorleon, sorry but i not understand fine what you mean, this code is for generate wowzamediaserver_casterstats.log

what you want to do ?

stefano

Ok. I am a little confused here.

I have installed casterstats dashboard and setting it up.

On the stream editor, what must I put in, where it says (Mount, Publishing, Filter:)

I can connect to the server however I do not get any stats.

Thanks