http_logs
Creates, updates, deletes, gets or lists a http_logs resource.
Overview​
| Name | http_logs |
| Type | Resource |
| Id | railway.observability.http_logs |
Fields​
The following fields are returned by SELECT queries:
- list
One row per HttpLog. The result of a http logs query.
| Name | Datatype | Description |
|---|---|---|
deployment_id | string | The deployment ID that was requested |
deployment_instance_id | string | The deployment instance ID that was requested |
request_id | string | The unique request ID |
client_ua | string | The client user agent |
downstream_proto | string | The downstream HTTP protocol version |
edge_region | string | The edge region the client connected to |
host | string | The requested host |
http_status | integer | The http status of the log |
method | string | The request HTTP method |
path | string | The requested path |
response_details | string | Details about the upstream response |
rx_bytes | integer | Received bytes |
src_ip | string | The source IP of the request |
timestamp | string | The timestamp the log was created |
total_duration | integer | The total duration the request took |
tx_bytes | integer | Outgoing bytes |
upstream_address | string | The upstream address |
upstream_errors | string | Any upstream errors that occurred |
upstream_proto | string | The upstream HTTP protocol version |
upstream_rq_duration | integer | How long the upstream request took to respond |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | deployment_id | after_date, after_limit, anchor_date, before_date, before_limit, filter | Fetch HTTP logs for a deployment. Backed by the Railway GraphQL query httpLogs. A SQL LIMIT is pushed down to the limit argument. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
deployment_id | string | |
after_date | string | Latest date to look for logs after the anchor. |
after_limit | integer | Limit the number of logs returned after the anchor. |
anchor_date | string | Target date time to look for logs. |
before_date | string | Oldest date to look for logs before the anchor. |
before_limit | integer | Limit the number of logs returned before the anchor. |
filter | string | Filter logs using a query syntax. |
SELECT examples​
- list
Fetch HTTP logs for a deployment. Backed by the Railway GraphQL query httpLogs. A SQL LIMIT is pushed down to the limit argument.
SELECT
deployment_id,
deployment_instance_id,
request_id,
client_ua,
downstream_proto,
edge_region,
host,
http_status,
method,
path,
response_details,
rx_bytes,
src_ip,
timestamp,
total_duration,
tx_bytes,
upstream_address,
upstream_errors,
upstream_proto,
upstream_rq_duration
FROM railway.observability.http_logs
WHERE deployment_id = '{{ deployment_id }}' -- required
AND after_date = '{{ after_date }}'
AND after_limit = '{{ after_limit }}'
AND anchor_date = '{{ anchor_date }}'
AND before_date = '{{ before_date }}'
AND before_limit = '{{ before_limit }}'
AND filter = '{{ filter }}'
;