GraylogAPI

Gem Version Build Status

Ruby gem for working with Graylog via the Graylog REST API

Installation

gem install graylogapi

Dependencies

  • net/http
  • json

Graylog documentation

Usage

Structure of gem looks like Graylog REST Api or navigation menu in UI. For example, you can find Inputs in System/Inputs in the UI and you can find Inputs in GraylogAPI.new(...).system.inputs in the gem.

get Input by id

graylogapi = Graylog.new('http://localhost:9000/api', 'username', 'password')
graylogapi.system.inputs.by_id('5947d3840b5712166af25009')

Supported methods

  • Alerts: Manage stream alerts for all streams
    • recent(params) — Get the most recent alarms of all streams.
    • paginated(params) — Get alarms of all streams, filtered by specifying limit and offset parameters.
    • by_id(id, params) — Get an alert by ID.
  • Streams: Manage streams
    • all — Get a list of all streams.
    • create(params) — Create a stream.
    • enabled — Get a list of all enabled streams.
    • by_id — Get a single stream.
    • update(id, params) — Update a stream.
    • delete(id) — Delete a stream.
    • clone(id, params) — Clone a stream.
    • pause(id) — Pause a stream.
    • resume(id) — Resume a stream.
  • System: System informatino of this node.
    • overview — Get system overview.
    • jvm — Get JVM information.
    • thread_dump — Get a thread dump.
  • System/Cluster: Node discovery
    • node — Infromation about this node.
    • nodes — List all active nodes in this cluster.
    • node_by_id — Infromation about a node.
  • System/IndexSets: Index sets
    • all — Get a list of all index sets.
    • create(params) — Create index set.
    • by_id(id) — Get index set by id.
    • delete(id) — Delete index set.
  • System/Inputs: Message inputs
    • all — Get all inputs.
    • by_id(id, params) — Get information of a single input on this node.
    • create(params) — Launch input on this node.
    • update(params) — Update input on this node.
    • delete(id) — Terminate input on this node.

Copytight (c) 2017 Andrey Aleksandrov

See LICENSE for details.