Created
March 13, 2012 20:35
-
-
Save tolland/2031393 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## put this in the path called genconfig; | |
#!/bin/bash | |
tmpfile=$(mktemp) | |
erb -T - $1 > $tmpfile | |
echo $tmpfile | |
# now you can make erb logstash templates like so; | |
input { file { | |
type => "syslog" | |
add_field => [ "offset", "<%= `echo -n $(date +%z)` -%>" ] | |
}} | |
# and invoke them like this; | |
$ grep "offset" $(genconfig test1.erb) | |
add_field => [ "offset", "+0000" ] | |
or... | |
$ java -jar logstash-monolith.jar agent -f $(genconfig myinputs.conf.erb) | |
Or you could just use chef! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment