This document shows step-by-step instructions of how to get the BigAnimal Postgres logs and export them to a file. This is applied to BigAnimal at Azure and logs are forwarded to Azure Log Analytics workspace.
- The cloud provider for BigAnimal is Azure;
- The logs from the Postgres clusters are forwarded to the Azure Log Analytics workspace.
1. Open Azure Log Analytics workspaces.
2. Filter by Tags - ManagedBy BigAnimal to locate to the log analytics instance.
3. Click 'Logs' to query the logs.
4. Get the specific database cluster logs
Input below KQL search string to get the logs, please replace the $CLUSTER_ID at pg_cluster_id_s == '$CLUSTER_ID' with your BigAnimal cluster ID (Document has the instruction of how to get the cluster ID).
| where pg_cluster_id_s == 'p-c6dga9d6vp7f3n6t068g'
| extend error_severity = extractjson("$.record.error_severity", Message), log_message = extractjson("$.record.message", Message), sql_state_code = extractjson("$.record.sql_state_code", Message)
| project TimeGenerated, record_log_time_s, pg_cluster_id_s, error_severity, log_message, sql_state_code, msg_s, logging_pod_s, Message
| sort by TimeGenerated asc
You can change the 'Time range', the default value is 'Last 24 hours'.
You can export the logs to CSV file by the 'Export' function.