@grow-codes/graylog - v0.1.1
    Preparing search index...

    Class GraylogClient

    Client for Graylog Open: health, REST admin (inputs, streams, index sets), search, and log clients that send through GELF (UDP, TCP, HTTP) or OTLP/gRPC.

    Index

    The immutable configuration.

    • Flushes and closes every log client created by logClient, then releases connections. Idempotent.

      Returns Promise<void>

    • Creates an input: POST /api/system/inputs. Returns its id. Unknown types raise NotFoundError. Graylog does not reject a busy port here: check getInputState (or use ensureGelfInput).

      Parameters

      Returns Promise<string>

    • Creates a stream (POST /api/streams) in the given (default: the default) index set and resumes it unless start: false (Graylog creates streams paused). Returns the stream id.

      Parameters

      Returns Promise<string>

    • Deletes an input: DELETE /api/system/inputs/{id}; NotFoundError when unknown.

      Parameters

      Returns Promise<void>

    • Deletes a stream: DELETE /api/streams/{id}; NotFoundError when unknown.

      Parameters

      Returns Promise<void>

    • Returns a running GELF input for protocol and port, creating it when none exists (matched by type, port and bind address). Waits until the input is RUNNING; a FAILED input (e.g. port in use) raises ConflictError and an input created by this call is deleted again. TimeoutError after timeoutMs.

      Parameters

      Returns Promise<EnsuredInput>

    • Unauthenticated liveness: GET /api/system/lbstatus. ALIVE → healthy ok, 429 THROTTLED → degraded, 503 DEAD → unhealthy. Never throws for an unhealthy or unreachable service (only CANCELLED and CONFIG).

      Parameters

      Returns Promise<HealthStatus>

    • Every indexed field name: GET /api/system/fields.

      Parameters

      Returns Promise<string[]>

    • Installed input types, class name → human name: GET /api/system/inputs/types.

      Parameters

      Returns Promise<Record<string, string>>

    • Authenticated round trip: GET /api/system. Returns the latency in milliseconds.

      Parameters

      Returns Promise<number>

    • Starts (resumes) a paused stream: POST /api/streams/{id}/resume.

      Parameters

      Returns Promise<void>

    • Searches messages with a Lucene query (POST /api/views/search/sync). Query errors (HTTP 200 with errors) raise ValidationError. An empty query matches everything.

      Parameters

      Returns Promise<SearchResult>

    • Server version as reported by GET /api/system, e.g. 7.0.16+58e0f6e.

      Parameters

      Returns Promise<string>