logstash: update default version to v6
This commit is contained in:
parent
cd62790201
commit
13db07a092
|
@ -257,6 +257,7 @@ with lib;
|
||||||
(mkRemovedOptionModule [ "fonts" "fontconfig" "forceAutohint" ] "")
|
(mkRemovedOptionModule [ "fonts" "fontconfig" "forceAutohint" ] "")
|
||||||
(mkRemovedOptionModule [ "fonts" "fontconfig" "renderMonoTTFAsBitmap" ] "")
|
(mkRemovedOptionModule [ "fonts" "fontconfig" "renderMonoTTFAsBitmap" ] "")
|
||||||
(mkRemovedOptionModule [ "virtualisation" "xen" "qemu" ] "You don't need this option anymore, it will work without it.")
|
(mkRemovedOptionModule [ "virtualisation" "xen" "qemu" ] "You don't need this option anymore, it will work without it.")
|
||||||
|
(mkRemovedOptionModule [ "services" "logstash" "enableWeb" ] "The web interface was removed from logstash")
|
||||||
|
|
||||||
# ZSH
|
# ZSH
|
||||||
(mkRenamedOptionModule [ "programs" "zsh" "enableSyntaxHighlighting" ] [ "programs" "zsh" "syntaxHighlighting" "enable" ])
|
(mkRenamedOptionModule [ "programs" "zsh" "enableSyntaxHighlighting" ] [ "programs" "zsh" "syntaxHighlighting" "enable" ])
|
||||||
|
|
|
@ -4,25 +4,12 @@ with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.logstash;
|
cfg = config.services.logstash;
|
||||||
atLeast54 = versionAtLeast (builtins.parseDrvName cfg.package.name).version "5.4";
|
|
||||||
pluginPath = lib.concatStringsSep ":" cfg.plugins;
|
pluginPath = lib.concatStringsSep ":" cfg.plugins;
|
||||||
havePluginPath = lib.length cfg.plugins > 0;
|
havePluginPath = lib.length cfg.plugins > 0;
|
||||||
ops = lib.optionalString;
|
ops = lib.optionalString;
|
||||||
verbosityFlag =
|
verbosityFlag = "--log.level " + cfg.logLevel;
|
||||||
if atLeast54
|
|
||||||
then "--log.level " + cfg.logLevel
|
|
||||||
else {
|
|
||||||
debug = "--debug";
|
|
||||||
info = "--verbose";
|
|
||||||
warn = ""; # intentionally empty
|
|
||||||
error = "--quiet";
|
|
||||||
fatal = "--silent";
|
|
||||||
}."${cfg.logLevel}";
|
|
||||||
|
|
||||||
pluginsPath =
|
pluginsPath = "--path.plugins ${pluginPath}";
|
||||||
if atLeast54
|
|
||||||
then "--path.plugins ${pluginPath}"
|
|
||||||
else "--pluginpath ${pluginPath}";
|
|
||||||
|
|
||||||
logstashConf = pkgs.writeText "logstash.conf" ''
|
logstashConf = pkgs.writeText "logstash.conf" ''
|
||||||
input {
|
input {
|
||||||
|
@ -63,7 +50,7 @@ in
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.logstash;
|
default = pkgs.logstash;
|
||||||
defaultText = "pkgs.logstash";
|
defaultText = "pkgs.logstash";
|
||||||
example = literalExample "pkgs.logstash";
|
example = literalExample "pkgs.logstash5";
|
||||||
description = "Logstash package to use.";
|
description = "Logstash package to use.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -95,12 +82,6 @@ in
|
||||||
description = "The quantity of filter workers to run.";
|
description = "The quantity of filter workers to run.";
|
||||||
};
|
};
|
||||||
|
|
||||||
enableWeb = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Enable the logstash web interface.";
|
|
||||||
};
|
|
||||||
|
|
||||||
listenAddress = mkOption {
|
listenAddress = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "127.0.0.1";
|
default = "127.0.0.1";
|
||||||
|
@ -174,16 +155,6 @@ in
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
assertions = [
|
|
||||||
{ assertion = atLeast54 -> !cfg.enableWeb;
|
|
||||||
message = ''
|
|
||||||
The logstash web interface is only available for versions older than 5.4.
|
|
||||||
So either set services.logstash.enableWeb = false,
|
|
||||||
or set services.logstash.package to an older logstash.
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.services.logstash = with pkgs; {
|
systemd.services.logstash = with pkgs; {
|
||||||
description = "Logstash Daemon";
|
description = "Logstash Daemon";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
@ -193,14 +164,12 @@ in
|
||||||
ExecStartPre = ''${pkgs.coreutils}/bin/mkdir -p "${cfg.dataDir}" ; ${pkgs.coreutils}/bin/chmod 700 "${cfg.dataDir}"'';
|
ExecStartPre = ''${pkgs.coreutils}/bin/mkdir -p "${cfg.dataDir}" ; ${pkgs.coreutils}/bin/chmod 700 "${cfg.dataDir}"'';
|
||||||
ExecStart = concatStringsSep " " (filter (s: stringLength s != 0) [
|
ExecStart = concatStringsSep " " (filter (s: stringLength s != 0) [
|
||||||
"${cfg.package}/bin/logstash"
|
"${cfg.package}/bin/logstash"
|
||||||
(ops (!atLeast54) "agent")
|
|
||||||
"-w ${toString cfg.filterWorkers}"
|
"-w ${toString cfg.filterWorkers}"
|
||||||
(ops havePluginPath pluginsPath)
|
(ops havePluginPath pluginsPath)
|
||||||
"${verbosityFlag}"
|
"${verbosityFlag}"
|
||||||
"-f ${logstashConf}"
|
"-f ${logstashConf}"
|
||||||
(ops atLeast54 "--path.settings ${logstashSettingsDir}")
|
"--path.settings ${logstashSettingsDir}"
|
||||||
(ops atLeast54 "--path.data ${cfg.dataDir}")
|
"--path.data ${cfg.dataDir}"
|
||||||
(ops cfg.enableWeb "-- web -a ${cfg.listenAddress} -p ${cfg.port}")
|
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
{ elk6Version
|
|
||||||
, enableUnfree ? true
|
|
||||||
, stdenv
|
|
||||||
, fetchurl
|
|
||||||
, makeWrapper
|
|
||||||
, jre
|
|
||||||
}:
|
|
||||||
|
|
||||||
with stdenv.lib;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
version = elk6Version;
|
|
||||||
name = "logstash-${optionalString (!enableUnfree) "oss-"}${version}";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://artifacts.elastic.co/downloads/logstash/${name}.tar.gz";
|
|
||||||
sha256 =
|
|
||||||
if enableUnfree
|
|
||||||
then "0yx9hpiav4d5z1b52x2h5i0iknqs9lmxy8vmz0wkb23mjiz8njdr"
|
|
||||||
else "1ir8pbq706mxr56k5cgc9ajn2jp603zrqj66dimx6xxf2nfamw0w";
|
|
||||||
};
|
|
||||||
|
|
||||||
dontBuild = true;
|
|
||||||
dontPatchELF = true;
|
|
||||||
dontStrip = true;
|
|
||||||
dontPatchShebangs = true;
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
makeWrapper jre
|
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out
|
|
||||||
cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out
|
|
||||||
|
|
||||||
patchShebangs $out/bin/logstash
|
|
||||||
patchShebangs $out/bin/logstash-plugin
|
|
||||||
|
|
||||||
wrapProgram $out/bin/logstash \
|
|
||||||
--set JAVA_HOME "${jre}"
|
|
||||||
|
|
||||||
wrapProgram $out/bin/logstash-plugin \
|
|
||||||
--set JAVA_HOME "${jre}"
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
|
||||||
description = "Logstash is a data pipeline that helps you process logs and other event data from a variety of systems";
|
|
||||||
homepage = https://www.elastic.co/products/logstash;
|
|
||||||
license = if enableUnfree then licenses.elastic else licenses.asl20;
|
|
||||||
platforms = platforms.unix;
|
|
||||||
maintainers = with maintainers; [ wjlroe offline basvandijk ];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,12 +1,23 @@
|
||||||
{ stdenv, fetchurl, makeWrapper, jre }:
|
{ elk6Version
|
||||||
|
, enableUnfree ? true
|
||||||
|
, stdenv
|
||||||
|
, fetchurl
|
||||||
|
, makeWrapper
|
||||||
|
, jre
|
||||||
|
}:
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "2.4.0";
|
version = elk6Version;
|
||||||
name = "logstash-${version}";
|
name = "logstash-${optionalString (!enableUnfree) "oss-"}${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://download.elasticsearch.org/logstash/logstash/logstash-${version}.tar.gz";
|
url = "https://artifacts.elastic.co/downloads/logstash/${name}.tar.gz";
|
||||||
sha256 = "1k27hb6q1r26rp3y9pb2ry92kicw83mi352dzl2y4h0gbif46b32";
|
sha256 =
|
||||||
|
if enableUnfree
|
||||||
|
then "0yx9hpiav4d5z1b52x2h5i0iknqs9lmxy8vmz0wkb23mjiz8njdr"
|
||||||
|
else "1ir8pbq706mxr56k5cgc9ajn2jp603zrqj66dimx6xxf2nfamw0w";
|
||||||
};
|
};
|
||||||
|
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
|
@ -20,14 +31,14 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
cp -r {Gemfile*,vendor,lib,bin} $out
|
cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out
|
||||||
|
|
||||||
|
patchShebangs $out/bin/logstash
|
||||||
|
patchShebangs $out/bin/logstash-plugin
|
||||||
|
|
||||||
wrapProgram $out/bin/logstash \
|
wrapProgram $out/bin/logstash \
|
||||||
--set JAVA_HOME "${jre}"
|
--set JAVA_HOME "${jre}"
|
||||||
|
|
||||||
wrapProgram $out/bin/rspec \
|
|
||||||
--set JAVA_HOME "${jre}"
|
|
||||||
|
|
||||||
wrapProgram $out/bin/logstash-plugin \
|
wrapProgram $out/bin/logstash-plugin \
|
||||||
--set JAVA_HOME "${jre}"
|
--set JAVA_HOME "${jre}"
|
||||||
'';
|
'';
|
||||||
|
@ -35,8 +46,8 @@ stdenv.mkDerivation rec {
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Logstash is a data pipeline that helps you process logs and other event data from a variety of systems";
|
description = "Logstash is a data pipeline that helps you process logs and other event data from a variety of systems";
|
||||||
homepage = https://www.elastic.co/products/logstash;
|
homepage = https://www.elastic.co/products/logstash;
|
||||||
license = licenses.asl20;
|
license = if enableUnfree then licenses.elastic else licenses.asl20;
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
maintainers = [ maintainers.wjlroe maintainers.offline ];
|
maintainers = with maintainers; [ wjlroe offline basvandijk ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3468,12 +3468,12 @@ with pkgs;
|
||||||
|
|
||||||
lockfileProgs = callPackage ../tools/misc/lockfile-progs { };
|
lockfileProgs = callPackage ../tools/misc/lockfile-progs { };
|
||||||
|
|
||||||
logstash = callPackage ../tools/misc/logstash { };
|
|
||||||
logstash5 = callPackage ../tools/misc/logstash/5.x.nix { };
|
logstash5 = callPackage ../tools/misc/logstash/5.x.nix { };
|
||||||
logstash6 = callPackage ../tools/misc/logstash/6.x.nix { };
|
logstash6 = callPackage ../tools/misc/logstash { };
|
||||||
logstash6-oss = callPackage ../tools/misc/logstash/6.x.nix {
|
logstash6-oss = callPackage ../tools/misc/logstash {
|
||||||
enableUnfree = false;
|
enableUnfree = false;
|
||||||
};
|
};
|
||||||
|
logstash = logstash6;
|
||||||
|
|
||||||
logstash-contrib = callPackage ../tools/misc/logstash/contrib.nix { };
|
logstash-contrib = callPackage ../tools/misc/logstash/contrib.nix { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue