From 34bf5720a9e28c20eb4fede94f1a8813ce762dd2 Mon Sep 17 00:00:00 2001 From: Seth Chisamore Date: Wed, 7 Dec 2016 16:48:53 -0500 Subject: [PATCH] Add plan for Logstash 5 Signed-off-by: Seth Chisamore --- logstash/config/logstash.conf | 8 ++++++++ logstash/hooks/init | 6 ++++++ logstash/hooks/run | 11 +++++++++++ logstash/plan.sh | 27 +++++++++++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 logstash/config/logstash.conf create mode 100644 logstash/hooks/init create mode 100644 logstash/hooks/run create mode 100644 logstash/plan.sh diff --git a/logstash/config/logstash.conf b/logstash/config/logstash.conf new file mode 100644 index 0000000000..c8054b106a --- /dev/null +++ b/logstash/config/logstash.conf @@ -0,0 +1,8 @@ +input { + file { + path => "{{pkg.svc_var_path}}/log/logstash-plain.log" + } +} +output { + stdout { codec => rubydebug } +} diff --git a/logstash/hooks/init b/logstash/hooks/init new file mode 100644 index 0000000000..64291cb954 --- /dev/null +++ b/logstash/hooks/init @@ -0,0 +1,6 @@ +#!/bin/sh + +exec 2>&1 + +mkdir -p {{pkg.svc_var_path}}/data +mkdir -p {{pkg.svc_var_path}}/log diff --git a/logstash/hooks/run b/logstash/hooks/run new file mode 100644 index 0000000000..abd3112211 --- /dev/null +++ b/logstash/hooks/run @@ -0,0 +1,11 @@ +#!/bin/sh + +exec 2>&1 + +export USE_RUBY=1 + +exec {{pkg.path}}/bin/logstash \ + --path.config {{pkg.svc_config_path}} \ + --path.data {{pkg.svc_var_path}}/data \ + --path.logs {{pkg.svc_var_path}}/log \ + --path.settings {{pkg.path}}/settings diff --git a/logstash/plan.sh b/logstash/plan.sh new file mode 100644 index 0000000000..981c4aba53 --- /dev/null +++ b/logstash/plan.sh @@ -0,0 +1,27 @@ +pkg_origin=core +pkg_name=logstash +pkg_version=5.0.2 +pkg_maintainer="The Habitat Maintainers " +pkg_license=(Apache-2.0) +pkg_source=https://artifacts.elastic.co/downloads/${pkg_name}/${pkg_name}-${pkg_version}.tar.gz +pkg_shasum=eff45f965118b6ef767f719d85f6dbca438ea2daa5e901907a32fa5bf1a70d9c +pkg_deps=(core/bash core/jre8 core/jruby1) +pkg_build_deps=(core/bash) +pkg_bin_dirs=(bin) +pkg_lib_dirs=(lib) + +do_build() { + return 0 +} + +do_install() { + mkdir -p $pkg_prefix + cp -r * $pkg_prefix + # The `config/' directory is special in Habitat so we'll just move + # the various config files that ship with Logstash into `settings' + # as Logstash refers to this location as SETTINGS_DIR. + mv $pkg_prefix/config $pkg_prefix/settings + rm -rf $pkg_prefix/data + rm -rf $pkg_prefix/vendor/jruby + fix_interpreter "${pkg_prefix}/bin/*" core/bash bin/sh +}