snowflake-query-logs
Collects Snowflake query execution logs.
snowflake-query-logs profile=PROFILE [duration=NUM{mon|w|d|h|m|s}] [from=yyyyMMddHHmmss] [to=yyyyMMddHHmmss] [order=ORDER]
- profile=PROFILE
- Snowflake profile name
- duration=NUM{mon|w|d|h|m|s}
- Time duration (e.g., 1d, 2h, 30m)
- from=yyyyMMddHHmmss
- Start time
- to=yyyyMMddHHmmss
- End time
- order=ORDER
- Sort order (asc or desc, default: desc)
Output Fields
Field | Type | Name | Description |
---|---|---|---|
_time | Date | Time | Statement start time |
session_id | Long | Session ID | Session identifier |
transaction_id | Long | Transaction ID | Transaction identifier |
query_id | String | Query ID | Internal/system-generated identifier for the SQL statement |
user | String | User | User who issued the query |
role | String | Role | Role used to execute the query |
role_type | String | Role Type | Type of role used |
query | String | Query | Text of the SQL statement |
query_type | String | Query Type | Type of SQL statement |
query_tag | String | Query Tag | Query tag assigned to the statement |
warehouse_name | String | Warehouse | Warehouse that executed the query |
user_type | String | User Type | Type of user who executed the query |
status | String | Status | Execution status (success, fail, incident) |
error_code | String | Error Code | Error code if query failed |
error_message | String | Error Message | Error message details |
elapsed_time | Long | Total Time | Total elapsed time in milliseconds |
end_time | Date | End Time | Statement end time |
database | String | Database | Database used for the query |
schema | String | Schema | Schema used for the query |
database_id | Long | Database ID | Database identifier |
schema_id | Long | Schema ID | Schema identifier |
user_database_name | String | User Database Name | Database name when the user type is SNOWFLAKE_SERVICE |
user_schema_name | String | User Schema Name | Schema name when the user type is SNOWFLAKE_SERVICE |
user_database_id | Long | User Database ID | Database ID when the user type is SNOWFLAKE_SERVICE |
user_schema_id | Long | User Schema ID | Schema ID when the user type is SNOWFLAKE_SERVICE |
warehouse_size | String | Warehouse Size | Size of the warehouse used |
warehouse_type | String | Warehouse Type | Type of warehouse used |
warehouse_id | Long | Warehouse ID | Warehouse identifier |
cluster_number | Integer | Cluster Number | Cluster number that executed the query |
execution_time | Long | Execution Time | Time spent executing the query |
compilation_time | Long | Compilation Time | Time spent compiling the query |
queued_overload_time | Long | Queued Overload Time | Time spent queued due to overload |
queued_provisioning_time | Long | Queued Provisioning Time | Time spent queued for provisioning |
queued_repair_time | Long | Queued Repair Time | Time spent queued for repair |
transaction_blocked_time | Long | Transaction Blocked Time | Time blocked by transactions |
child_queries_wait_time | Long | Child Queries Wait Time | Time spent waiting for child queries |
fault_handling_time | Long | Fault Handling Time | Time spent handling faults |
list_external_files_time | Long | List External Files Time | Time spent listing external files |
query_retry_time | Long | Query Retry Time | Total execution time for query retries |
query_retry_cause | String | Query Retry Cause | Cause of query retry |
bytes_scanned | Long | Bytes Scanned | Number of bytes scanned |
bytes_deleted | Long | Bytes Deleted | Number of bytes deleted |
bytes_read_from_result | Long | Bytes Read From Result | Number of bytes read from the query result |
bytes_sent_over_the_network | Long | Bytes Sent Over Network | Bytes sent over the network |
bytes_spilled_to_local_storage | Long | Bytes Spilled Local | Bytes spilled to local storage |
bytes_spilled_to_remote_storage | Long | Bytes Spilled Remote | Bytes spilled to remote storage |
bytes_written | Long | Bytes Written | Number of bytes written |
bytes_written_to_result | Long | Bytes Written To Result | Number of bytes written to the query result |
rows | Long | Rows Produced | Number of rows produced by the query |
rows_inserted | Long | Rows Inserted | Number of rows inserted |
rows_updated | Long | Rows Updated | Number of rows updated |
rows_deleted | Long | Rows Deleted | Number of rows deleted |
rows_unloaded | Long | Rows Unloaded | Number of rows unloaded |
rows_written_to_result | Long | Rows Written To Result | Number of rows written to the query result |
partitions_scanned | Long | Partitions Scanned | Number of partitions scanned |
partitions_total | Long | Total Partitions | Total number of partitions available |
percentage_scanned_from_cache | Double | Percentage Scanned From Cache | Percentage of data scanned from cache |
query_load_percent | Double | Query Load Percent | Query load percentage |
credits_used_cloud_services | Double | Credits Used | Cloud services credits consumed |
query_acceleration_bytes_scanned | Long | Query Acceleration Bytes Scanned | Bytes scanned by query acceleration |
query_acceleration_partitions_scanned | Long | Query Acceleration Partitions Scanned | Partitions scanned by query acceleration |
query_acceleration_upper_limit_scale_factor | Double | Query Acceleration Upper Limit Scale Factor | Query acceleration upper limit scale factor |
inbound_data_transfer_bytes | Long | Inbound Data Transfer Bytes | Inbound data transfer bytes |
inbound_data_transfer_cloud | String | Inbound Data Transfer Cloud | Inbound data transfer cloud |
inbound_data_transfer_region | String | Inbound Data Transfer Region | Inbound data transfer region |
outbound_data_transfer_bytes | Long | Outbound Data Transfer Bytes | Outbound data transfer bytes |
outbound_data_transfer_cloud | String | Outbound Data Transfer Cloud | Outbound data transfer cloud |
outbound_data_transfer_region | String | Outbound Data Transfer Region | Outbound data transfer region |
external_function_total_invocations | Long | External Function Total Invocations | Total external function invocations |
external_function_total_received_bytes | Long | External Function Total Received Bytes | Total bytes received by external functions |
external_function_total_received_rows | Long | External Function Total Received Rows | Total rows received by external functions |
external_function_total_sent_bytes | Long | External Function Total Sent Bytes | Total bytes sent to external functions |
external_function_total_sent_rows | Long | External Function Total Sent Rows | Total rows sent to external functions |
release_version | String | Release Version | Snowflake release version |
is_client_generated_statement | Bool | Is Client Generated Statement | Whether statement was generated by client |
secondary_role_stats | String | Secondary Role Stats | Secondary role statistics |
query_hash | String | Query Hash | Hash of the exact query text |
query_hash_version | Integer | Query Hash Version | Version of the query hash |
query_parameterized_hash | String | Query Parameterized Hash | Hash value created by removing literals from the query text and then hashing |
query_parameterized_hash_version | Integer | Query Parameterized Hash Version | Version of parameterized hash |