config

package
v0.0.0-...-e3fb0e6 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: Apache-2.0 Imports: 8 Imported by: 9

Documentation

Index

Constants

View Source
const (
	ChanSizes         = 100
	NumberOfPipelines = int32(4)
)
View Source
const (
	LOGS_RULES       = "LogsRules"
	TCP_TYPE         = "tcp"
	UDP_TYPE         = "udp"
	FILE_TYPE        = "file"
	DOCKER_TYPE      = "docker"
	EXCLUDE_AT_MATCH = "exclude_at_match"
	MASK_SEQUENCES   = "mask_sequences"
	MULTILINE        = "multi_line"
)
View Source
const (
	DateFormat = "2006-01-02T15:04:05.000000000Z"
)
View Source
const INTEGRATION_CONFIG_EXTENTION = ".yaml"
View Source
const MainConfig = "datadog"

MainConfig is the name of the main config file, while we haven't merged in dd agent

Variables

View Source
var (
	SEV_INFO  = []byte("<46>")
	SEV_ERROR = []byte("<43>")
)
View Source
var LogsAgent = ddconfig.Datadog

LogsAgent is the global configuration object

Functions

func BuildLogsAgentConfig

func BuildLogsAgentConfig(ddconfigPath, ddconfdPath string) error

BuildLogsAgentConfig initializes the LogsAgent config and sets default values

func BuildLogsAgentIntegrationsConfigs

func BuildLogsAgentIntegrationsConfigs(ddconfdPath string) error

BuildLogsAgentIntegrationsConfigs looks for all yml configs in the ddconfdPath directory, and initializes the LogsAgent integrations configs

func BuildTagsPayload

func BuildTagsPayload(configTags, source, sourceCategory string) []byte

Given a list of tags, BuildTagsPayload generates the bytes array that will be inserted into messages

Types

type IntegrationConfig

type IntegrationConfig struct {
	Logs []IntegrationConfigLogSource
}

IntegrationConfig represents a dd agent config, which includes infra and logs parts

type IntegrationConfigLogSource

type IntegrationConfigLogSource struct {
	Type string

	Port int    // Network
	Path string // File

	Image string // Docker
	Label string // Docker

	Service         string
	Logset          string
	Source          string
	SourceCategory  string
	Tags            string
	TagsPayload     []byte
	ProcessingRules []LogsProcessingRule `mapstructure:"log_processing_rules"`
}

IntegrationConfigLogSource represents a log source config, which can be for instance a file to tail or a port to listen to

func GetLogsSources

func GetLogsSources() []*IntegrationConfigLogSource

GetLogsSources returns a list of integration sources

type LogsProcessingRule

type LogsProcessingRule struct {
	Type                    string
	Name                    string
	ReplacePlaceholder      string `mapstructure:"replace_placeholder"`
	Pattern                 string
	Reg                     *regexp.Regexp
	ReplacePlaceholderBytes []byte
}

LogsProcessingRule defines an exclusion or a masking rule to be applied on log lines

Jump to

Keyboard shortcuts

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