Class: LogStash::Filters::Zabbix::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/filters/zabbix/cache.rb

Class Method Summary collapse

Class Method Details

.fetch(options) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/logstash/filters/zabbix/cache.rb', line 5

def self.fetch(options)
  zbx = ZabbixApi.connect(options)
  response = zbx.query(
    method: 'host.get',
    params: {
        groupids: options[:group_id],
        output: ['hostid', 'host'],
        selectItems: ['itemid', 'key_', 'formula'],
        selectInterfaces: ['ip'],
    });

  return parse(response, options[:keys])
end