Logs
The Storage Logs provide a convenient way to examine all incoming request logs to your Storage service. You can filter by time and keyword searches.
For more advanced filtering needs, use the SQL Editor with the query source set to Logs to query the Storage logs directly. A Logs query runs ClickHouse SQL rather than Postgres SQL. Every log line is a row in the logs table, tagged by a source column, with structured fields in a log_attributes map.
For more details on filtering the log tables, see Advanced Log Filtering
Example Storage queries#
Filter by status 5XX error#
select id, timestamp, event_message, toInt32OrZero(log_attributes['res.statusCode']) as statusCode, log_attributes['error.message'] as errorMessage, log_attributes['error.raw'] as rawErrorfrom logswhere source = 'storage_logs' and toInt32OrZero(log_attributes['res.statusCode']) >= 500order by timestamp desclimit 100;Filter by status 4XX error#
select id, timestamp, event_message, toInt32OrZero(log_attributes['res.statusCode']) as statusCode, log_attributes['error.message'] as errorMessage, log_attributes['error.raw'] as rawErrorfrom logswhere source = 'storage_logs' and toInt32OrZero(log_attributes['res.statusCode']) between 400 and 499order by timestamp desclimit 100;Filter by method#
select id, timestamp, event_message, log_attributes['req.method'] as methodfrom logswhere source = 'storage_logs' and log_attributes['req.method'] in ('POST')order by timestamp desclimit 100;Filter by IP address#
select id, timestamp, event_message, log_attributes['req.remoteAddress'] as remoteAddressfrom logswhere source = 'storage_logs' and log_attributes['req.remoteAddress'] in ('IP_ADDRESS')order by timestamp desclimit 100;