Documentation ¶
Index ¶
- Constants
- func Convert(info *LogInfoNode) (map[string]string, error)
- func ReadFile(path string, separator string) ([]string, error)
- func Register(format string, converter FormatConverter)
- func Run(templ string, baseDir string) error
- type Config
- type FileInode
- type FilebeatPiloter
- func (p *FilebeatPiloter) GetBaseConf() string
- func (p *FilebeatPiloter) GetConfHome() string
- func (p *FilebeatPiloter) GetConfPath(container string) string
- func (p *FilebeatPiloter) Name() string
- func (p *FilebeatPiloter) OnDestroyEvent(container string) error
- func (p *FilebeatPiloter) Reload() error
- func (p *FilebeatPiloter) Start() error
- func (p *FilebeatPiloter) Stop() error
- type FluentdPiloter
- func (p *FluentdPiloter) GetBaseConf() string
- func (p *FluentdPiloter) GetConfHome() string
- func (p *FluentdPiloter) GetConfPath(container string) string
- func (p *FluentdPiloter) Name() string
- func (p *FluentdPiloter) OnDestroyEvent(container string) error
- func (p *FluentdPiloter) Reload() error
- func (p *FluentdPiloter) Start() error
- func (p *FluentdPiloter) Stop() error
- type FormatConverter
- type LogConfig
- type LogInfoNode
- type Pilot
- type Piloter
- type RegistryState
- type SimpleConverter
Constants ¶
const ( FILEBEAT_EXEC_CMD = "/usr/bin/filebeat" FILEBEAT_REGISTRY = "/var/lib/filebeat/registry" FILEBEAT_BASE_CONF = "/etc/filebeat" FILEBEAT_CONF_DIR = FILEBEAT_BASE_CONF + "/prospectors.d" FILEBEAT_CONF_FILE = FILEBEAT_BASE_CONF + "/filebeat.yml" DOCKER_SYSTEM_PATH = "/var/lib/docker/" KUBELET_SYSTEM_PATH = "/var/lib/kubelet/" ENV_FILEBEAT_OUTPUT = "FILEBEAT_OUTPUT" )
Global variables for FilebeatPiloter
const ( FLUENTD_EXEC_CMD = "/usr/bin/fluentd" FLUENTD_BASE_CONF = "/etc/fluentd" FLUENTD_CONF_DIR = FLUENTD_BASE_CONF + "/conf.d" FLUENTD_CONF_FILE = FLUENTD_BASE_CONF + "/fluentd.conf" FLUENTD_PLUGINS = FLUENTD_BASE_CONF + "/plugins" ENV_FLUENTD_OUTPUT = "FLUENTD_OUTPUT" ENV_FLUENTD_WORKER = "FLUENTD_WORKER" )
Global variables for FluentdPiloter
const ( ENV_PILOT_LOG_PREFIX = "PILOT_LOG_PREFIX" ENV_PILOT_CREATE_SYMLINK = "PILOT_CREATE_SYMLINK" ENV_LOGGING_OUTPUT = "LOGGING_OUTPUT" ENV_SERVICE_LOGS_TEMPL = "%s_logs_" LABEL_SERVICE_LOGS_TEMPL = "%s.logs." LABEL_PROJECT_SWARM_MODE = "com.docker.stack.namespace" LABEL_PROJECT = "com.docker.compose.project" LABEL_SERVICE = "com.docker.compose.service" LABEL_SERVICE_SWARM_MODE = "com.docker.swarm.service.name" LABEL_K8S_POD_NAMESPACE = "io.kubernetes.pod.namespace" LABEL_K8S_CONTAINER_NAME = "io.kubernetes.container.name" LABEL_POD = "io.kubernetes.pod.name" SYMLINK_LOGS_BASE = "/acs/log/" ERR_ALREADY_STARTED = "already started" )
Global variables
const ( ENV_PILOT_TYPE = "PILOT_TYPE" PILOT_FILEBEAT = "filebeat" PILOT_FLUENTD = "fluentd" )
Global variables for piloter
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
func Convert(info *LogInfoNode) (map[string]string, error)
Convert convert node info to map
func Register ¶
func Register(format string, converter FormatConverter)
Register format converter instance
Types ¶
type FilebeatPiloter ¶
type FilebeatPiloter struct {
// contains filtered or unexported fields
}
FilebeatPiloter for filebeat plugin
func (*FilebeatPiloter) GetBaseConf ¶ added in v0.9.7
func (p *FilebeatPiloter) GetBaseConf() string
GetBaseConf returns plugin root directory
func (*FilebeatPiloter) GetConfHome ¶ added in v0.9.6
func (p *FilebeatPiloter) GetConfHome() string
GetConfHome returns configuration directory
func (*FilebeatPiloter) GetConfPath ¶ added in v0.9.6
func (p *FilebeatPiloter) GetConfPath(container string) string
GetConfPath returns log configuration path
func (*FilebeatPiloter) OnDestroyEvent ¶
func (p *FilebeatPiloter) OnDestroyEvent(container string) error
OnDestroyEvent watching destroy event
func (*FilebeatPiloter) Reload ¶
func (p *FilebeatPiloter) Reload() error
Reload reload configuration file
func (*FilebeatPiloter) Start ¶
func (p *FilebeatPiloter) Start() error
Start starting and watching filebeat process
type FluentdPiloter ¶
type FluentdPiloter struct {
// contains filtered or unexported fields
}
FluentdPiloter for fluentd plugin
func (*FluentdPiloter) GetBaseConf ¶ added in v0.9.7
func (p *FluentdPiloter) GetBaseConf() string
GetBaseConf returns plugin root directory
func (*FluentdPiloter) GetConfHome ¶ added in v0.9.6
func (p *FluentdPiloter) GetConfHome() string
GetConfHome returns configuration directory
func (*FluentdPiloter) GetConfPath ¶ added in v0.9.6
func (p *FluentdPiloter) GetConfPath(container string) string
GetConfPath returns log configuration path
func (*FluentdPiloter) OnDestroyEvent ¶
func (p *FluentdPiloter) OnDestroyEvent(container string) error
OnDestroyEvent watching destroy event
func (*FluentdPiloter) Reload ¶
func (p *FluentdPiloter) Reload() error
Reload reload configuration file
func (*FluentdPiloter) Start ¶
func (p *FluentdPiloter) Start() error
Start starting and watching fluentd process
type FormatConverter ¶
type FormatConverter func(info *LogInfoNode) (map[string]string, error)
FormatConverter converts node info to map
type LogConfig ¶
type LogConfig struct { Name string HostDir string ContainerDir string Format string FormatConfig map[string]string File string Tags map[string]string Target string EstimateTime bool Stdout bool }
LogConfig log configuration
type LogInfoNode ¶
type LogInfoNode struct {
// contains filtered or unexported fields
}
LogInfoNode node info
type Piloter ¶
type Piloter interface { Name() string Start() error Reload() error Stop() error GetBaseConf() string GetConfHome() string GetConfPath(container string) string OnDestroyEvent(container string) error }
Piloter interface for piloter
func NewFilebeatPiloter ¶
NewFilebeatPiloter returns a FilebeatPiloter instance
func NewFluentdPiloter ¶
NewFluentdPiloter returns a FluentdPiloter instance
func NewPiloter ¶ added in v0.9.6
NewPiloter instantiates a new piloter
type RegistryState ¶
type RegistryState struct { Source string `json:"source"` Offset int64 `json:"offset"` Timestamp time.Time `json:"timestamp"` TTL time.Duration `json:"ttl"` Type string `json:"type"` FileStateOS FileInode }
RegistryState represents log offsets
type SimpleConverter ¶
type SimpleConverter struct {
// contains filtered or unexported fields
}
SimpleConverter simple format converter