Skip to content
Storage

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.

Example Storage queries#

Filter by status 5XX error#

1
select
2
id,
3
timestamp,
4
event_message,
5
toInt32OrZero(log_attributes['res.statusCode']) as statusCode,
6
log_attributes['error.message'] as errorMessage,
7
log_attributes['error.raw'] as rawError
8
from logs
9
where source = 'storage_logs'
10
and toInt32OrZero(log_attributes['res.statusCode']) >= 500
11
order by timestamp desc
12
limit 100;

Filter by status 4XX error#

1
select
2
id,
3
timestamp,
4
event_message,
5
toInt32OrZero(log_attributes['res.statusCode']) as statusCode,
6
log_attributes['error.message'] as errorMessage,
7
log_attributes['error.raw'] as rawError
8
from logs
9
where source = 'storage_logs'
10
and toInt32OrZero(log_attributes['res.statusCode']) between 400 and 499
11
order by timestamp desc
12
limit 100;

Filter by method#

1
select id, timestamp, event_message, log_attributes['req.method'] as method
2
from logs
3
where source = 'storage_logs'
4
and log_attributes['req.method'] in ('POST')
5
order by timestamp desc
6
limit 100;

Filter by IP address#

1
select id, timestamp, event_message, log_attributes['req.remoteAddress'] as remoteAddress
2
from logs
3
where source = 'storage_logs'
4
and log_attributes['req.remoteAddress'] in ('IP_ADDRESS')
5
order by timestamp desc
6
limit 100;