Class: GraylogAPI::Extractors

Inherits:
Object
  • Object
show all
Defined in:
lib/graylogapi/extractors.rb

Overview

class for manage Extractors of an input

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Extractors

Returns a new instance of Extractors.



4
5
6
# File 'lib/graylogapi/extractors.rb', line 4

def initialize(client)
  @client = client
end

Instance Method Details

#create(input_id, params) ⇒ GraylogAPI::Client::Response

add key to an input

Parameters:

  • input_id (Integer)

    id of an input

  • params (Hash)

    hash with key and value of new extractor

Returns:



13
14
15
# File 'lib/graylogapi/extractors.rb', line 13

def create(input_id, params)
  @client.request(:post, "/system/inputs/#{input_id}/extractors", params)
end

#delete(input_id, key) ⇒ GraylogAPI::Client::Response

delete key of an input

Parameters:

  • input_id (Integer)

    id of an input

  • key (String)

    key of extractor

Returns:



22
23
24
# File 'lib/graylogapi/extractors.rb', line 22

def delete(input_id, key)
  @client.request(:delete, "/system/inputs/#{input_id}/extractors/#{key}")
end