Skip to content

Instantly share code, notes, and snippets.

@Bert-R
Bert-R / logical-replication.md
Last active March 25, 2023 17:24
Logical replication using text_decoding and pgoutput

Commands to play with logical replication

Using test_decoding plug-in

SELECT pg_create_logical_replication_slot('demo_slot', 'test_decoding');

SELECT pg_logical_emit_message(true, 'context', 'Hello World!');

SELECT pg_logical_slot_peek_changes('demo_slot', NULL, NULL, 'include-xids', '0');
@Bert-R
Bert-R / docker-desktop-filebeat.md
Created April 27, 2022 07:30
Shipping Docker Desktop logs to Elasticsearch using Filebeat

It's sometimes really useful to ship the logs of Docker Desktop to Elasticsearch. This gist describes the required steps. They need to be performed in your favorite WSL2 distro.

  1. Mount the UNC path of Docker Desktop:
sudo mkdir /mnt/docker-desktop-data
sudo mount -t drvfs '\\wsl$\docker-desktop-data' /mnt/docker-desktop-data/
  1. Create a folder for Filebeat. Here it's created under /tmp:
cd /tmp
mkdir -p filebeat/data filebeat/config