1. enable MariaDB Audit
http://teguhth.blogspot.com/2022/08/enable-server-audit-in-mariadb-mysql.html
2. convert to table
http://teguhth.blogspot.com/2022/09/load-log-file-insert-into-table-in.html
3. check filter tbl_mariadb_audit to filter connect & disconnect
MariaDB [teguhthtools]> select * from tbl_mariadb_audit where type ='connect' or type ='disconnect';
+-------------------+---------+--------+-----------+------+---------------+------------+------+---------+--------+
| date | host | userdb | client | id | connection_id | type | db | sqltext | status |
+-------------------+---------+--------+-----------+------+---------------+------------+------+---------+--------+
| 20240822 07:52:09 | teguhth | admin | teguhth | 4 | 0 | CONNECT | | | 0 |
| 20240822 07:52:32 | teguhth | admin | teguhth | 4 | 0 | DISCONNECT | | | 0 |
+-------------------+---------+--------+-----------+------+---------------+------------+------+---------+--------+
3 rows in set (0.001 sec)
MariaDB [teguhthtools]>
http://teguhth.blogspot.com/2022/08/enable-server-audit-in-mariadb-mysql.html
2. convert to table
http://teguhth.blogspot.com/2022/09/load-log-file-insert-into-table-in.html
3. check filter tbl_mariadb_audit to filter connect & disconnect
MariaDB [teguhthtools]> select * from tbl_mariadb_audit where type ='connect' or type ='disconnect';
+-------------------+---------+--------+-----------+------+---------------+------------+------+---------+--------+
| date | host | userdb | client | id | connection_id | type | db | sqltext | status |
+-------------------+---------+--------+-----------+------+---------------+------------+------+---------+--------+
| 20240822 07:52:09 | teguhth | admin | teguhth | 4 | 0 | CONNECT | | | 0 |
| 20240822 07:52:32 | teguhth | admin | teguhth | 4 | 0 | DISCONNECT | | | 0 |
+-------------------+---------+--------+-----------+------+---------------+------------+------+---------+--------+
3 rows in set (0.001 sec)
MariaDB [teguhthtools]>