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.