diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index bc5f18d22bcc..f1c25377acd2 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -85,6 +85,7 @@ in
flannel = handleTestOn ["x86_64-linux"] ./flannel.nix {};
flatpak = handleTest ./flatpak.nix {};
flatpak-builder = handleTest ./flatpak-builder.nix {};
+ fluentd = handleTest ./fluentd.nix {};
fsck = handleTest ./fsck.nix {};
fwupd = handleTestOn ["x86_64-linux"] ./fwupd.nix {}; # libsmbios is unsupported on aarch64
gdk-pixbuf = handleTest ./gdk-pixbuf.nix {};
diff --git a/nixos/tests/fluentd.nix b/nixos/tests/fluentd.nix
new file mode 100644
index 000000000000..e5c4c3d21631
--- /dev/null
+++ b/nixos/tests/fluentd.nix
@@ -0,0 +1,46 @@
+import ./make-test.nix ({ pkgs, lib, ... }: {
+ name = "fluentd";
+
+ machine = { pkgs, ... }: {
+ services.fluentd = {
+ enable = true;
+ config = ''
+
+ @type http
+ port 9880
+
+
+
+ type copy
+
+ @type file
+ format json
+ path /tmp/fluentd
+ symlink_path /tmp/current-log
+
+
+ @type stdout
+
+
+ '';
+ };
+ };
+
+ testScript = let
+ testMessage = "an example log message";
+
+ payload = pkgs.writeText "test-message.json" (builtins.toJSON {
+ inherit testMessage;
+ });
+ in ''
+ $machine->start;
+ $machine->waitForUnit('fluentd.service');
+ $machine->waitForOpenPort(9880);
+
+ $machine->succeed("curl -fsSL -X POST -H 'Content-type: application/json' -d @${payload} http://localhost:9880/test.tag");
+
+ $machine->succeed("systemctl stop fluentd"); # blocking flush
+
+ $machine->succeed("grep '${testMessage}' /tmp/current-log");
+ '';
+})