summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2017-01-25 22:11:40 +0100
committerGitHub <noreply@github.com>2017-01-25 22:11:40 +0100
commit117e5547d1f60096139221f1b2f54956a14f913a (patch)
treeef788ffd47ab2fe1f8a291472c7aa00424462f86 /nixos
parentd01b9493c982c308d929211dcbcb4efea0207cf4 (diff)
parente9c6cf02e6886bfc91f3bb866184e95054199ff1 (diff)
downloadnixpkgs-117e5547d1f60096139221f1b2f54956a14f913a.tar
nixpkgs-117e5547d1f60096139221f1b2f54956a14f913a.tar.gz
nixpkgs-117e5547d1f60096139221f1b2f54956a14f913a.tar.bz2
nixpkgs-117e5547d1f60096139221f1b2f54956a14f913a.tar.lz
nixpkgs-117e5547d1f60096139221f1b2f54956a14f913a.tar.xz
nixpkgs-117e5547d1f60096139221f1b2f54956a14f913a.tar.zst
nixpkgs-117e5547d1f60096139221f1b2f54956a14f913a.zip
Merge pull request #21311 from makefu/services/logstash
services.logstash: default options, examples and address update
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/rename.nix1
-rw-r--r--nixos/modules/services/logging/logstash.nix14
2 files changed, 8 insertions, 7 deletions
diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix
index ad1ba86980d..8d3c0a66ef4 100644
--- a/nixos/modules/rename.nix
+++ b/nixos/modules/rename.nix
@@ -18,6 +18,7 @@ with lib;
     (mkRenamedOptionModule [ "services" "elasticsearch" "host" ] [ "services" "elasticsearch" "listenAddress" ])
     (mkRenamedOptionModule [ "services" "graphite" "api" "host" ] [ "services" "graphite" "api" "listenAddress" ])
     (mkRenamedOptionModule [ "services" "graphite" "web" "host" ] [ "services" "graphite" "web" "listenAddress" ])
+    (mkRenamedOptionModule [ "services" "logstash" "address" ] [ "services" "logstash" "listenAddress" ])
     (mkRenamedOptionModule [ "services" "kibana" "host" ] [ "services" "kibana" "listenAddress" ])
     (mkRenamedOptionModule [ "services" "mpd" "network" "host" ] [ "services" "mpd" "network" "listenAddress" ])
     (mkRenamedOptionModule [ "services" "neo4j" "host" ] [ "services" "neo4j" "listenAddress" ])
diff --git a/nixos/modules/services/logging/logstash.nix b/nixos/modules/services/logging/logstash.nix
index 62f6e187ea0..c9477b9e3ab 100644
--- a/nixos/modules/services/logging/logstash.nix
+++ b/nixos/modules/services/logging/logstash.nix
@@ -63,7 +63,7 @@ in
         description = "Enable the logstash web interface.";
       };
 
-      address = mkOption {
+      listenAddress = mkOption {
         type = types.str;
         default = "0.0.0.0";
         description = "Address on which to start webserver.";
@@ -77,7 +77,7 @@ in
 
       inputConfig = mkOption {
         type = types.lines;
-        default = ''stdin { type => "example" }'';
+        default = ''generator { }'';
         description = "Logstash input configuration.";
         example = ''
           # Read from journal
@@ -90,7 +90,7 @@ in
 
       filterConfig = mkOption {
         type = types.lines;
-        default = ''noop {}'';
+        default = "";
         description = "logstash filter configuration.";
         example = ''
           if [type] == "syslog" {
@@ -108,11 +108,11 @@ in
 
       outputConfig = mkOption {
         type = types.lines;
-        default = ''stdout { debug => true debug_format => "json"}'';
+        default = ''stdout { codec => rubydebug }'';
         description = "Logstash output configuration.";
         example = ''
-          redis { host => "localhost" data_type => "list" key => "logstash" codec => json }
-          elasticsearch { embedded => true }
+          redis { host => ["localhost"] data_type => "list" key => "logstash" codec => json }
+          elasticsearch { }
         '';
       };
 
@@ -147,7 +147,7 @@ in
               ${cfg.outputConfig}
             }
           ''} " +
-          ops cfg.enableWeb "-- web -a ${cfg.address} -p ${cfg.port}";
+          ops cfg.enableWeb "-- web -a ${cfg.listenAddress} -p ${cfg.port}";
       };
     };
   };