Documentation ¶
Overview ¶
Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Index ¶
- func ParseFBOutput(line string) (sanitizedLine string, agentSeverity logrus.Level)
- type CfgLoader
- type ConfigChangesWatcher
- type FBCfg
- type FBCfgExternal
- type FBCfgFilter
- type FBCfgInput
- type FBCfgOutput
- type FBWinlogLuaScript
- type LogCfg
- type LogExternalFBCfg
- type LogSyslogCfg
- type LogTcpCfg
- type LogWinevtlogCfg
- type LogWinlogCfg
- type LogsCfg
- type YAML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseFBOutput ¶
ParseFBOutput sanitizes line (stripping FB severity and timestamp) and provides agent severity. Agent severity should be either: Debug, Warn or Error. FB-Info maps to agent-Debug. FB lines expected to be format: [2020/03/04 15:57:54] [ info] [input] pausing tail.0 2020/03/09 20:21:54 [DEBUG] Error making HTTP request. Got status code: 403
Types ¶
type CfgLoader ¶
type CfgLoader struct {
// contains filtered or unexported fields
}
func NewFolderLoader ¶
func (*CfgLoader) GetConfigDir ¶
func (*CfgLoader) GetLicenseKey ¶ added in v0.1.0
func (*CfgLoader) LoadAll ¶
LoadAll loads and parses the logging configuration. It returns ok=false in case an error occurred, which should block the start of the log forwarding feature.
func (*CfgLoader) LoadAndFormat ¶
func (l *CfgLoader) LoadAndFormat() (string, FBCfgExternal, error)
type ConfigChangesWatcher ¶
type ConfigChangesWatcher struct {
// contains filtered or unexported fields
}
ConfigChangesWatcher will look in a path for changes in the configuration.
func NewConfigChangesWatcher ¶
func NewConfigChangesWatcher(path string) *ConfigChangesWatcher
NewConfigChangesWatcher creates a new instance of ConfigChangesWatcher.
func (*ConfigChangesWatcher) Watch ¶
func (ccw *ConfigChangesWatcher) Watch(ctx ctx2.Context, changes chan<- struct{})
Watch is registering a channel to push notifications when a change in the watched path is detected.
type FBCfg ¶
type FBCfg struct { Inputs []FBCfgInput Filters []FBCfgFilter ExternalCfg FBCfgExternal Output FBCfgOutput }
FBCfg FluentBit automatically generated configuration.
type FBCfgExternal ¶
FBCfgExternal represents an existing set of native FluentBit configuration files that should be merged with the auto-generated FB configuration
type FBCfgFilter ¶
type FBCfgFilter struct { Name string Match string Regex string // plugin: grep Records map[string]string // plugin: record_modifier Script string // plugin:lua-Script Call string // plugin:lua-Script Modifiers map[string]string //plugin: modify filter }
FBCfgFilter FluentBit FILTER config block, only "grep" plugin supported.
[FILTER] Name grep Match nri-service Regex MESSAGE info
type FBCfgInput ¶
type FBCfgInput struct { Name string Tag string DB string Path string // plugin: tail BufferMaxSize string // plugin: tail PathKey string // plugin: tail SkipLongLines string // always on Systemd_Filter string // plugin: systemd Channels string // plugin: winlog SyslogMode string // plugin: syslog SyslogListen string // plugin: syslog SyslogPort int // plugin: syslog SyslogParser string // plugin: syslog SyslogUnixPath string // plugin: syslog SyslogUnixPermissions string // plugin: syslog BufferChunkSize string // plugin: syslog udp/udp_unix TcpListen string // plugin: tcp TcpPort int // plugin: tcp TcpFormat string // plugin: tcp TcpSeparator string // plugin: tcp TcpBufferSize int // plugin: tcp (note that the "tcp" plugin uses Buffer_Size (without "k"s!) instead of Buffer_Max_Size (with "k"s!)) }
FBCfgInput FluentBit INPUT config block for either "tail", "systemd", "winlog", "winevtlog" or "syslog" plugins. Tail plugin expected shape:
[INPUT] Name tail Path /var/log/newrelic-infra/newrelic-infra.log Tag nri-file DB fb.db
Systemd plugin expected shape: [INPUT]
Name systemd Systemd_Filter _SYSTEMD_UNIT=newrelic-infra.service Tag newrelic-infra DB fb.db
type FBCfgOutput ¶
type FBCfgOutput struct { Name string Match string LicenseKey string Endpoint string // empty for US, value required for EU or staging IgnoreSystemProxy bool Proxy string CABundleFile string CABundleDir string ValidateCerts bool Retry_Limit string }
FBCfgOutput FluentBit Output config block, supporting NR output plugin. https://github.com/newrelic/newrelic-fluent-bit-output
type FBWinlogLuaScript ¶
func (FBWinlogLuaScript) Format ¶
func (script FBWinlogLuaScript) Format() (result string, err error)
Format will return the formatted lua script that fluent bit config is pointing to.
type LogCfg ¶
type LogCfg struct { Name string `yaml:"name"` File string `yaml:"file"` // ... MaxLineKb int `yaml:"max_line_kb"` // Setup the max value of the buffer while reading lines. Systemd string `yaml:"systemd"` // ... Pattern string `yaml:"pattern"` Attributes map[string]string `yaml:"attributes"` Syslog *LogSyslogCfg `yaml:"syslog"` Tcp *LogTcpCfg `yaml:"tcp"` Fluentbit *LogExternalFBCfg `yaml:"fluentbit"` Winlog *LogWinlogCfg `yaml:"winlog"` Winevtlog *LogWinevtlogCfg `yaml:"winevtlog"` }
LogCfg logging integration config from customer defined YAML.
type LogExternalFBCfg ¶
type LogSyslogCfg ¶
type LogSyslogCfg struct { URI string `yaml:"uri"` Parser string `yaml:"parser"` UnixPermissions string `yaml:"unix_permissions"` }
LogSyslogCfg logging integration config from customer defined YAML, specific for the Syslog input plugin