Skip to content

Commit

Permalink
Add plan for Logstash 5
Browse files Browse the repository at this point in the history
Signed-off-by: Seth Chisamore <schisamo@chef.io>
  • Loading branch information
schisamo committed Dec 7, 2016
1 parent 8d71599 commit 34bf572
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
8 changes: 8 additions & 0 deletions logstash/config/logstash.conf
@@ -0,0 +1,8 @@
input {
file {
path => "{{pkg.svc_var_path}}/log/logstash-plain.log"
}
}
output {
stdout { codec => rubydebug }
}
6 changes: 6 additions & 0 deletions 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
11 changes: 11 additions & 0 deletions 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
27 changes: 27 additions & 0 deletions logstash/plan.sh
@@ -0,0 +1,27 @@
pkg_origin=core
pkg_name=logstash
pkg_version=5.0.2
pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>"
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
}

0 comments on commit 34bf572

Please sign in to comment.