mdblog()
Returns recent log messages from the Metadb system. You can optionally specify a time interval to filter logs.Signature
The time period to retrieve logs from (e.g., ‘1 hour’, ‘30 minutes’). If omitted, returns logs from the past 24 hours.
Usage
Example Output
Use Cases
Troubleshooting Issues
Troubleshooting Issues
Check recent errors when investigating system problems:
Monitoring Warnings
Monitoring Warnings
Monitor warning messages to catch potential issues early:
Tracking Events
Tracking Events
Search logs for specific events or patterns:
ps()
Returns information about currently running query processes, similar to the Unixps command.
Signature
Returns a table with the following columns:
The database name the query is running against
The user executing the query
The current state of the process (e.g., ‘active’, ‘idle’, ‘idle in transaction’)
The elapsed wall-clock time the query has been running
The SQL query text being executed
Usage
Example Output
Use Cases
Monitor Active Queries
Monitor Active Queries
See which queries are currently executing:
Find Long-Running Queries
Find Long-Running Queries
Identify queries that have been running for an extended period:
User Activity Overview
User Activity Overview
See what each user is currently doing:
The
ps() function shows processes across all databases. Filter by dbname if you only want to see activity in a specific database.Severity Levels
Log messages inmdblog() use the following severity levels (from least to most severe):
INFO
Informational messages about normal operations (e.g., “Stream processor started”)
WARNING
Warnings about potential issues that don’t prevent operation (e.g., “High memory usage”)
ERROR
Errors that affect specific operations but don’t crash the system (e.g., “Connection timeout”)
FATAL
Critical errors that may cause system shutdown or data loss
Related Resources
metadb.log Table
Query the complete log history
System Info Functions
Get version and user information
metadb.table_update
Track table update statistics
