filebeat

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentConfig

func GetCurrentConfig(logger *logger.Logger) (*client.RequestFilebeat, error)

GetCurrentConfig reads the current filebeat configuration

func GetServiceStatus

func GetServiceStatus(ctx context.Context, logger *logger.Logger, runner *cmdrunner.CommandsRunner) (*client.ServiceStatus, error)

GetServiceStatus returns the current filebeat service status using systemd package

func RestartService

func RestartService(ctx context.Context, logger *logger.Logger, runner *cmdrunner.CommandsRunner) error

RestartService restarts the filebeat service

func ServiceControl

func ServiceControl(ctx context.Context, serviceName string, action client.SubCommandType, logger *logger.Logger, runner *cmdrunner.CommandsRunner) (*client.ServiceStatus, error)

ServiceControl performs service control operations (start/stop/restart/status)

func UpdateConfig

func UpdateConfig(ctx context.Context, config *client.RequestFilebeat, logger *logger.Logger, runner *cmdrunner.CommandsRunner) error

UpdateConfig writes new filebeat configuration

Types

type ElasticsearchOutputConfig

type ElasticsearchOutputConfig struct {
	Hosts               []string `yaml:"hosts"`
	Index               string   `yaml:"index,omitempty"` // Index pattern (e.g., "elchi-%{+yyyy.MM.dd}")
	Loadbalance         bool     `yaml:"loadbalance,omitempty"`
	SSLVerificationMode string   `yaml:"ssl.verification_mode,omitempty"` // "none" to skip SSL verify
	APIKey              string   `yaml:"api_key,omitempty"`
	Username            string   `yaml:"username,omitempty"`
	Password            string   `yaml:"password,omitempty"`
}

ElasticsearchOutputConfig represents elasticsearch output configuration

type FilebeatConfig

type FilebeatConfig struct {
	FilebeatInputs      []FilebeatInputConfig      `yaml:"filebeat.inputs"`
	Processors          []any                      `yaml:"processors"`
	OutputLogstash      *LogstashOutputConfig      `yaml:"output.logstash,omitempty"`
	OutputElasticsearch *ElasticsearchOutputConfig `yaml:"output.elasticsearch,omitempty"`
	SetupILM            *SetupILMConfig            `yaml:"setup.ilm,omitempty"`
	SetupTemplate       *SetupTemplateConfig       `yaml:"setup.template,omitempty"`
}

FilebeatConfig represents the full filebeat.yml structure

type FilebeatInputConfig

type FilebeatInputConfig struct {
	Type    string   `yaml:"type"`
	Enabled bool     `yaml:"enabled"`
	ID      string   `yaml:"id"`
	Paths   []string `yaml:"paths"`
}

FilebeatInputConfig represents a single filebeat input

type LogstashOutputConfig

type LogstashOutputConfig struct {
	Hosts       []string `yaml:"hosts"`
	Loadbalance bool     `yaml:"loadbalance"`
}

LogstashOutputConfig represents logstash output configuration

type SetupILMConfig

type SetupILMConfig struct {
	Enabled bool `yaml:"enabled"`
}

SetupILMConfig represents ILM (Index Lifecycle Management) configuration

type SetupTemplateConfig

type SetupTemplateConfig struct {
	Name    string `yaml:"name"`
	Pattern string `yaml:"pattern"`
}

SetupTemplateConfig represents index template configuration

Jump to

Keyboard shortcuts

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