Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTailerSrc ¶
Types ¶
type FileConfig ¶
type FileConfig struct { //The file path for input log file. FilePath string `toml:"file_path"` //The blacklist used to filter out some files Blacklist string `toml:"blacklist"` PublishMultiLogs bool `toml:"publish_multi_logs"` Encoding string `toml:"encoding"` //The log group name for the input log file. LogGroupName string `toml:"log_group_name"` //log stream name LogStreamName string `toml:"log_stream_name"` //The regex of the timestampFromLogLine presents in the log entry TimestampRegex string `toml:"timestamp_regex"` //The timestampFromLogLine layout used in GoLang to parse the timestampFromLogLine. TimestampLayout string `toml:"timestamp_layout"` //The time zone used to parse the timestampFromLogLine in the log entry. Timezone string `toml:"timezone"` //Indicate whether it is a start of multiline. //If this config is not present, it means the multiline mode is disabled. //If this config is specified as "{timestamp_regex}", it means to use the same regex as timestampFromLogLine. //If this config is specified as some regex, it will use the regex to determine if this line is a start line of multiline entry. MultiLineStartPattern string `toml:"multi_line_start_pattern"` // automatically remove the file / symlink after uploading. // This auto removal does not support the case where other log rotation mechanism is already in place. AutoRemoval bool `toml:"auto_removal"` //Indicate whether to tail the log file from the beginning or not. //The default value for this field should be set as true in configuration. //Otherwise, it may skip some log entries for timestampFromLogLine suffix roatated new file. FromBeginning bool `toml:"from_beginning"` //Indicate whether it is a named pipe. Pipe bool `toml:"pipe"` //Indicate logType for scroll LogType string `toml:"log_type"` //Log Destination override Destination string `toml:"destination"` //Max size for a single log event to be in bytes MaxEventSize int `toml:"max_event_size"` //Suffix to be added to truncated logline to indicate its truncation TruncateSuffix string `toml:"truncate_suffix"` //Indicate retention in days for log group RetentionInDays int `toml:"retention_in_days"` Filters []*LogFilter `toml:"filters"` //Time *time.Location Go type timezone info. TimezoneLoc *time.Location //Regexp go type timestampFromLogLine regex TimestampRegexP *regexp.Regexp //Regexp go type multiline start regex MultiLineStartPatternP *regexp.Regexp //Regexp go type blacklist regex BlacklistRegexP *regexp.Regexp //Decoder object Enc encoding.Encoding // contains filtered or unexported fields }
The file config presents the structure of configuration for a file to be tailed.
type LogFile ¶
type LogFile struct { //array of file config for file to be monitored. FileConfig []FileConfig `toml:"file_config"` //store the offset of file already published. FileStateFolder string `toml:"file_state_folder"` //destination Destination string `toml:"destination"` Log telegraf.Logger `toml:"-"` // contains filtered or unexported fields }
func NewLogFile ¶
func NewLogFile() *LogFile
func (*LogFile) Description ¶
func (*LogFile) FindLogSrc ¶
Try to find if there is any new file needs to be added for monitoring.
func (*LogFile) SampleConfig ¶
Click to show internal directories.
Click to hide internal directories.