Monitoring the meeting recordings views

105 views
Skip to first unread message

Anton Petrov

unread,
Dec 1, 2021, 8:36:02 AM12/1/21
to BigBlueButton-dev
Hi all, I'd like to share the requirement and possible solution. 
The client would like to know how many times a given meeting recording on the BBB server is viewed. This info could be extracted from the /var/log/nginx/bigbluebutton.access.log. In that file multiple requests are recorded for any given record playback. So I've decided to use the  "... GET /presentation/<internal-meeting-id>/metadata.xml ..." lines, which are always presented exactly once per playback.
The problem is, this log is rotated and archived by logrotate scripts and even deleted after some period. So the total views of a given recording can't be extracted easily and even at all after let's say a month.
The suggested solution is to record those requests in another access.log file in some folder which will not be rotated nor deleted automatically.
Added in the beginning of the /etc/nginx/sites-available/bigbluebutton

map $request $recordview {
    ~.*metadata\.xml.* 1;
    default 0;
}

and then add in the server context:
access_log  /home/<your_user>/bigbluebutton.accessRecords.log combined if=$recordview;

This way all the requests, containing "metadata.xml" will be added into the ~/bigbluebutton.accessRecords.log file infinitely. 

Then I could

grep "<internal-meeting-id>/metadata.xml" ~/bigbluebutton.accessRecords.log

to get all the views of the given recording.

This works for me so far. I'd like to know from the BBB devs is that solution correct and maybe there is a better approach?

P.S. I tried two times to mark the code blocks in this post, but couldn't find the way. It seems the ``` (triple backticks) syntax and html <pre> tags doesn't work. How did you do that?

sd...@distancelearning.cloud

unread,
Dec 1, 2021, 8:49:09 AM12/1/21
to bigblueb...@googlegroups.com

Each nginx entry has timestamp/ip address..  I would just make an hourly/daily cron, that greps the metadata.xml from current log file,  does a sort -u unique to make sure it only appears once into master log.

 

So no changes to nginx,  just few lines of bash in a cron…

 

Regards,

Stephen

 

 

From: bigblueb...@googlegroups.com <bigblueb...@googlegroups.com> On Behalf Of Anton Petrov
Sent: Wednesday, December 1, 2021 7:44 AM
To: BigBlueButton-dev <bigblueb...@googlegroups.com>
Subject: [bigbluebutton-dev] Monitoring the meeting recordings views

 

Hi all, I'd like to share the requirement and possible solution. 

The client would like to know how many times a given meeting recording on the BBB server is viewed. This info could be extracted from the /var/log/nginx/bigbluebutton.access.log. In that file multiple requests are recorded for any given record playback. So I've decided to use the  "... GET /presentation/<internal-meeting-id>/metadata.xml ..." lines, which are always presented exactly once per playback.

The problem is, this log is rotated and archived by logrotate scripts and even deleted after some period. So the total views of a given recording can't be extracted easily and even at all after let's say a month.

The suggested solution is to record those requests in another access.log file in some folder which will not be rotated nor deleted automatically.

Added in the beginning of the /etc/nginx/sites-available/bigbluebutton

```

map $request $recordview {

     ~.*metadata\.xml.* 1;

         default 0;

}

```

and then add in the server context:

```

access_log  /home/<your_user>/bigbluebutton.accessRecords.log combined if=$recordview;

```

This way all the requests, containing "metadata.xml" will be added into the ~/bigbluebutton.accessRecords.log file infinitely. 

Then I could

```grep "<internal-meeting-id>/metadata.xml" ~/bigbluebutton.accessRecords.log```

to get all the views of the given recording.

This works for me so far. I'd like to know from the BBB devs is that solution correct and maybe there is a better approach?

--
You received this message because you are subscribed to the Google Groups "BigBlueButton-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bigbluebutton-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bigbluebutton-dev/ff3815e7-0395-495b-8492-da49f74ba78dn%40googlegroups.com.

Anton Petrov

unread,
Dec 1, 2021, 9:43:52 AM12/1/21
to BigBlueButton-dev
Stephen, thanks for the comment! 
The cron task approach is fine, but I'd not know the actual views before the cron task is processed. Adding entries at once upon the receiving requests makes my file up to date in any given moment.
Also I'm not sure about the unique filtering and grepping. If anyone started the same playback twice per day, I'd like to count 2 views.
grep "GET /presentation/<intenal-meeting-id>/metadata.xml" should return unique entry-per-view anyways.

Greetings,
Anton

Reply all
Reply to author
Forward
0 new messages