Documentation
¶
Index ¶
- Constants
- func LoadFileID(fi os.FileInfo, path string) (map[string]interface{}, error)
- func New(c *config.Config) (pipeline.Processor, error)
- func NewFromConfig(cfg Config) (pipeline.Processor, error)
- func SaveFileState(path string, source FileState)
- type Cluster
- type Config
- type FSEvent
- type File
- type FileDetector
- type FileState
- type LogEvent
- type LogsProcessor
- func (p *LogsProcessor) GetAgentMeta() *event2.AgentMeta
- func (p *LogsProcessor) Name() string
- func (p *LogsProcessor) Process(c *pipeline.Context) error
- func (p *LogsProcessor) ReadJsonLogs(event FSEvent, c *pipeline.Context)
- func (p *LogsProcessor) ReadLogs(event FSEvent, c *pipeline.Context)
- func (p *LogsProcessor) ReadMultilineLogs(event FSEvent, c *pipeline.Context)
- func (p *LogsProcessor) ReadPlainTextLogs(event FSEvent, c *pipeline.Context)
- func (p *LogsProcessor) Save(event FSEvent, logContent util.MapStr, timestamp string)
- type Node
- type Operation
- type Pattern
Constants ¶
View Source
const ( FileTypeJSON = "json" FileTypeText = "text" FileTypeMultiline = "multiline" )
View Source
const (
KVLogfileStateBucket = "log_state_bucket"
)
Variables ¶
This section is empty.
Functions ¶
func SaveFileState ¶
Types ¶
type FileDetector ¶
type FileDetector struct {
// contains filtered or unexported fields
}
func NewFileDetector ¶
func NewFileDetector(rootPath string, patterns []*Pattern) *FileDetector
func (*FileDetector) Detect ¶
func (w *FileDetector) Detect(ctx context.Context)
func (*FileDetector) Event ¶
func (w *FileDetector) Event() FSEvent
func (*FileDetector) IsSameFile ¶
IsSameFile whether preState's file info and current file info describe the same file
type FileState ¶
type FileState struct { Name string `json:"name"` Size int64 `json:"size"` ModTime time.Time `json:"mod_time"` Path string `json:"path"` Offset int64 `json:"offset"` Sys any `json:"sys"` }
func GetFileState ¶
type LogEvent ¶
type LogEvent struct { AgentMeta *event.AgentMeta `json:"agent" elastic_mapping:"agent: { type: object }"` Meta util.MapStr `json:"metadata" elastic_mapping:"metadata: { type: object }"` Fields util.MapStr `json:"payload" elastic_mapping:"payload: { type: object }"` Timestamp string `json:"timestamp,omitempty" elastic_mapping:"timestamp: { type: date }"` }
type LogsProcessor ¶
type LogsProcessor struct {
// contains filtered or unexported fields
}
func (*LogsProcessor) GetAgentMeta ¶
func (p *LogsProcessor) GetAgentMeta() *event2.AgentMeta
func (*LogsProcessor) Name ¶
func (p *LogsProcessor) Name() string
func (*LogsProcessor) ReadJsonLogs ¶
func (p *LogsProcessor) ReadJsonLogs(event FSEvent, c *pipeline.Context)
func (*LogsProcessor) ReadLogs ¶
func (p *LogsProcessor) ReadLogs(event FSEvent, c *pipeline.Context)
func (*LogsProcessor) ReadMultilineLogs ¶
func (p *LogsProcessor) ReadMultilineLogs(event FSEvent, c *pipeline.Context)
func (*LogsProcessor) ReadPlainTextLogs ¶
func (p *LogsProcessor) ReadPlainTextLogs(event FSEvent, c *pipeline.Context)
type Pattern ¶
type Pattern struct { Pattern string `config:"pattern"` Metadata util.MapStr `config:"metadata"` Type string `config:"type"` LinePattern string `config:"line_pattern"` RemoveFields []string `config:"remove_fields"` TimestampFields []string `config:"timestamp_fields"` TimestampPatterns []string `config:"timestamp_patterns"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.