Sha256: 881d5893d35496646947576c8ae9676cd2a12f283559e02bec331e1658e33f5e
Contents?: true
Size: 983 Bytes
Versions: 2
Compression:
Stored size: 983 Bytes
Contents
# encoding: utf-8 require "logstash/namespace" require "logstash/outputs/base" # This output will run a command for any matching event. # # Example: # # output { # exec { # type => abuse # command => "iptables -A INPUT -s %{clientip} -j DROP" # } # } # # Run subprocesses via system ruby function # # WARNING: if you want it non-blocking you should use & or dtach or other such # techniques class LogStash::Outputs::Exec < LogStash::Outputs::Base config_name "exec" milestone 1 # Command line to execute via subprocess. Use dtach or screen to make it non blocking config :command, :validate => :string, :required => true public def register @logger.debug("exec output registered", :config => @config) end # def register public def receive(event) return unless output?(event) @logger.debug("running exec command", :command => event.sprintf(@command)) system(event.sprintf(@command)) end # def receive end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
logstash-output-exec-0.1.0 | lib/logstash/outputs/exec.rb |
logstash-lib-1.3.2 | lib/logstash/outputs/exec.rb |