mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
- style cleanup
This commit is contained in:
parent
cb776e3e7b
commit
df6e2d491d
1 changed files with 7 additions and 7 deletions
|
@ -14,7 +14,7 @@ require "logstash/outputs/base"
|
|||
#
|
||||
# The easiest way to use this output is with the grep filter.
|
||||
# Presumably, you only want certain events matching a given pattern
|
||||
# to send events to zabbix. So use grep to match and also to add the required
|
||||
# to send events to zabbix, so use grep to match and also to add the required
|
||||
# fields.
|
||||
#
|
||||
# filter {
|
||||
|
@ -50,8 +50,8 @@ class LogStash::Outputs::Zabbix < LogStash::Outputs::Base
|
|||
|
||||
config_name "zabbix"
|
||||
|
||||
config :zabbix_server, :validate => :string, :default => "localhost"
|
||||
config :zabbix_port, :validate => :string, :default => "10051"
|
||||
config :host, :validate => :string, :default => "localhost"
|
||||
config :port, :validate => :number, :default => 10051
|
||||
config :zabbix_sender, :validate => :string, :default => "/usr/local/bin/zabbix_sender"
|
||||
|
||||
# Only handle events with any of these tags. Optional.
|
||||
|
@ -92,11 +92,11 @@ class LogStash::Outputs::Zabbix < LogStash::Outputs::Base
|
|||
return
|
||||
end
|
||||
|
||||
temp = event.message
|
||||
temp = temp.gsub("\n", "\\n")
|
||||
temp = temp.gsub(/"/, "\\\"")
|
||||
zmsg = event.message
|
||||
zmsg = zmsg.gsub("\n", "\\n")
|
||||
zmsg = zmsg.gsub(/"/, "\\\"")
|
||||
|
||||
cmd = "#{@zabbix_sender} -z #{@zabbix_server} -p #{@zabbix_port} -s #{host} -k #{item} -o \"#{temp}\" 2>/dev/null >/dev/null"
|
||||
cmd = "#{@zabbix_sender} -z #{@host} -p #{@port} -s #{host} -k #{item} -o \"#{zmsg}\" 2>/dev/null >/dev/null"
|
||||
|
||||
@logger.debug({"zabbix_sender_command" => cmd})
|
||||
begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue