So I was running out of disk space on our EMR a little too fast, and after investigating, it seems like our “log” table in the database was bloated by REST API calls from OCEAN doing stuff like checking out all our provider’s schedule for the next 7 days, every 20 minutes:
We use OCEAN for eReferral and it has been great. We don’t use it for appointment booking. We use Veribook, which is great as well (not excessive logging here compared to OCEAN).
All this activity generated 8,797,955 lines of “log” table SQL entries amounting to ~4.5 GB of space in this year 2023 alone. This was how our SQL database grew bloated more than the actual storage rate of patient data accumulated over the years.
Sample log data:
For those of you who use OCEAN, and are noticing rapid database/disk space usage, consider pruning your “log” table.
Here is my suggestions to prune “log” table for excessive API logs:
~$ df -h
~$ mysql -uroot -p --default-character-set=utf8 --opt --single-transaction --skip-add-drop-table --no-create-info --skip-triggers oscar_15 log > /usr/share/oscar-emr/OscarDocument/oscar/audit_log_purge/backup_audit-log.sql
~$ mysql -uroot -p
mysql> use oscar_15
mysql> delete from log where action like "%REST WS%" and (demographic_no IS NULL or contentId IS NULL or securityId IS NULL) and ip IN ("35.182.46.13","3.98.235.196","15.222.173.33","15.222.94.245",15.222.173.33","15.222.94.245");
msyql> SET GLOBAL innodb_file_per_table=ON
mysql> check table log
mysql> optimize table log
mysql> exit
~$ df -h
Reference:
Security Log Report (Audit Log) – World OSCAR
URLs, and IPs That Need to be Allowlisted for Ocean – OceanMD (cognisantmd.com)