# cf s Getting services in org system / space pg_space2 as admin... name service plan bound apps last operation broker upgrade available pg_ins_01 postgres large-on-demand-postgres-db update succeeded postgres-odb noNext, obtain the GUID of the service using the command "cf service --guid pg_ins_01":
$ cf service --guid pg_ins_01 438044f5-98af-4419-8eea-dff415a81f22Before gathering the logs, check if the virtual machine is available by running the command "bosh -d service-instance_<GUID> vms":
bosh -d service-instance_438044f5-98af-4419-8eea-dff415a81f22 vms Using environment '10.225.55.129' as client 'ops_manager' Task 516. Done Deployment 'service-instance_438044f5-98af-4419-8eea-dff415a81f22' Instance Process State AZ IPs VM CID VM Type Active Stemcell postgres-instance/284df4ab-eba7-485e-a0a5-ecaed3afc31f running az1 10.225.55.180 vm-bcffae72-e999-427a-a61f-fd35b43df80a large true bosh-vsphere-esxi-ubuntu-jammy-go_agent/1.260 1 vms Succeeded
Finally, gather the logs using the command "bosh -d service-instance_<GUID> logs";
bosh -d service-instance_438044f5-98af-4419-8eea-dff415a81f22 logs Using environment '10.225.55.129' as client 'ops_manager' Using deployment 'service-instance_438044f5-98af-4419-8eea-dff415a81f22' Task 517 Task 517 | 12:54:55 | Fetching logs for postgres-instance/284df4ab-eba7-485e-a0a5-ecaed3afc31f (0): Finding and packing log files (00:00:01) Task 517 Started Wed Oct 25 12:54:55 UTC 2023 Task 517 Finished Wed Oct 25 12:54:56 UTC 2023 Task 517 Duration 00:00:01 Task 517 done Downloading resource 'fd8b9550-4eb2-4a45-af39-d2c0f517b68b' to '/Users/jiangal/service-instance_438044f5-98af-4419-8eea-dff415a81f22-20231025-205459-55893.tgz'... [-------------------------------------------->______________________] 67.08% ? Succeeded
Once the extraction is complete, the logs will be organized in the following structure:
./ |-- bosh-dns | |-- bosh_dns.stderr.log | |-- bosh_dns.stdout.log | |-- bosh_dns_ctl.stderr.log | |-- bosh_dns_ctl.stdout.log | |-- bosh_dns_health.stderr.log | |-- bosh_dns_health.stdout.log | |-- bosh_dns_health_ctl.stderr.log | |-- bosh_dns_health_ctl.stdout.log | |-- bosh_dns_resolvconf.stderr.log | |-- bosh_dns_resolvconf.stdout.log | |-- bosh_dns_resolvconf_ctl.stderr.log | |-- bosh_dns_resolvconf_ctl.stdout.log | |-- post-start.stderr.log | |-- post-start.stdout.log | |-- pre-start.stderr.log | `-- pre-start.stdout.log |-- bpm | |-- pre-start.stderr.log | `-- pre-start.stdout.log |-- loggregator_agent | |-- bpm.log | |-- loggregator_agent.stderr.log | |-- loggregator_agent.stdout.log | |-- pre-start.stderr.log | `-- pre-start.stdout.log |-- postgres | |-- janitor.err.log | |-- janitor.log | |-- pg_janitor_ctl.err.log | |-- pg_janitor_ctl.log | |-- postgres_ctl.err.log | |-- postgres_ctl.log | |-- postgresql.log | |-- pre-start.stderr.log | |-- pre-start.stdout.log | `-- startup.log |-- postgres-backup | |-- backup-and-upload.log | |-- pre-start.stderr.log | `-- pre-start.stdout.log |-- postgres-metrics-exporter | `-- exporter.log |-- prom_scraper | |-- bpm.log | |-- prom_scraper.stderr.log | `-- prom_scraper.stdout.log |-- route_registrar | |-- bpm.log | |-- route_registrar.stderr.log | `-- route_registrar.stdout.log |-- service-instance_438044f5-98af-4419-8eea-dff415a81f22-20231025-205459-55893.tgz |-- service-metrics | |-- bpm.log | |-- service-metrics.stderr.log | `-- service-metrics.stdout.log `-- system-metrics-agent |-- system-metrics-agent.stderr.log `-- system-metrics-agent.stdout.log