Documentation
¶
Index ¶
- func GetCurrentConfig(logger *logger.Logger) (*client.RequestFilebeat, error)
- func GetServiceStatus(logger *logger.Logger, runner *cmdrunner.CommandsRunner) (*client.ServiceStatus, error)
- func RestartService(logger *logger.Logger, runner *cmdrunner.CommandsRunner) error
- func ServiceControl(serviceName string, action client.SubCommandType, logger *logger.Logger, ...) (*client.ServiceStatus, error)
- func UpdateConfig(config *client.RequestFilebeat, logger *logger.Logger, ...) error
- type ElasticsearchOutputConfig
- type FilebeatConfig
- type FilebeatInputConfig
- type LogstashOutputConfig
- type SetupILMConfig
- type SetupTemplateConfig
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(logger *logger.Logger, runner *cmdrunner.CommandsRunner) (*client.ServiceStatus, error)
GetServiceStatus returns the current filebeat service status using systemd package
func RestartService ¶
func RestartService(logger *logger.Logger, runner *cmdrunner.CommandsRunner) error
RestartService restarts the filebeat service
func ServiceControl ¶
func ServiceControl(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(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 ¶
SetupTemplateConfig represents index template configuration