Help us shape the future of Go! Take the 2026 Go Developer Survey

graylog

package
v1.4.31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package graylog provides bounded, scoped, read-only Graylog queries for native tools.

Index

Constants

View Source
const MaximumLimit = 100
View Source
const MaximumOffset = 99

Variables

View Source
var ErrInvalidArgument = errors.New("graylog: invalid argument")
View Source
var ErrInvalidConfig = errors.New("graylog: invalid configuration")
View Source
var ErrResponseTooLarge = errors.New("graylog: response too large")
View Source
var ErrUnsupportedScope = errors.New("graylog: configured query cannot be safely scoped")

Functions

This section is empty.

Types

type DiscoveryRequest

type DiscoveryRequest struct {
	Search        string
	Offset, Limit int
}

type DiscoveryResult

type DiscoveryResult struct {
	Fields     []string `json:"fields"`
	Count      int      `json:"count"`
	Offset     int      `json:"offset"`
	Limit      int      `json:"limit"`
	NextOffset int      `json:"next_offset,omitempty"`
	Truncated  bool     `json:"truncated"`
	Truncation []string `json:"truncation"`
	Coverage   string   `json:"coverage"`
}

type Policy

type Policy struct {
	MaxRows, MaxFields, MaxBytes int
	MaxLookback, Timeout         time.Duration
}

func ToolPolicy

func ToolPolicy() Policy

type ReadRequest

type ReadRequest struct {
	Filters       map[string]string
	Search        string
	Lookback      time.Duration
	Offset, Limit int
}

type ReadResult

type ReadResult struct {
	Records    []Record `json:"records"`
	Count      int      `json:"count"`
	Offset     int      `json:"offset"`
	Limit      int      `json:"limit"`
	NextOffset int      `json:"next_offset,omitempty"`
	Partial    bool     `json:"partial,omitempty"`
	Truncated  bool     `json:"truncated"`
	Truncation []string `json:"truncation,omitempty"`
}

type Record

type Record struct {
	Timestamp string            `json:"timestamp"`
	Message   string            `json:"message"`
	Fields    map[string]string `json:"fields"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(cfg config.AgentGraylogSourceConfig, scrubber core.Scrubber) (*Service, error)

func (*Service) Discover

func (service *Service) Discover(ctx context.Context, request DiscoveryRequest) (DiscoveryResult, error)

Discover samples a bounded recent search; the absolute search API does not promise a complete field inventory for the configured query and stream.

func (*Service) Read

func (service *Service) Read(ctx context.Context, request ReadRequest) (ReadResult, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL