Documentation
¶
Index ¶
- Constants
- func ConfiguredElasticSearchDocumentType() string
- func ConfiguredElasticSearchHosts() []string
- func ConfiguredElasticSearchIndex() string
- func ConfiguredElasticSearchMax() int
- func ConfiguredElasticSearchMocking() bool
- func ConfiguredElasticSearchPort() int
- func ConfiguredElasticSearchReportEvery() int64
- func ConfiguredElasticSearchScheme() string
- func ConfiguredElasticSearchUseDateSuffix() bool
- func ConfiguredFileOutputName() string
- func EsSetDefaults()
- type ElasticSearchWorker
- func (w *ElasticSearchWorker) CurrentCount() int
- func (w *ElasticSearchWorker) CurrentItems() []string
- func (w *ElasticSearchWorker) DocumentType() string
- func (w *ElasticSearchWorker) Endpoint() string
- func (w *ElasticSearchWorker) Index() string
- func (w *ElasticSearchWorker) Init() (err error)
- func (w *ElasticSearchWorker) Mocking() bool
- func (w *ElasticSearchWorker) NextHost() string
- func (w *ElasticSearchWorker) ReportEvery() int64
- func (w *ElasticSearchWorker) SetWorkChannel(channel chan map[string]interface{})
- func (w *ElasticSearchWorker) Start()
- func (w *ElasticSearchWorker) Stop()
- func (w *ElasticSearchWorker) UseDateSuffix() bool
- func (w *ElasticSearchWorker) Work()
- type FileWorker
- type LogParser
- func (w *LogParser) ConfigureRegex()
- func (w *LogParser) Init()
- func (w *LogParser) ParseEvents(line string) (map[string]interface{}, error)
- func (w *LogParser) ParseStringForValue(ts string) interface{}
- func (w *LogParser) ParseTime(ts string) (t time.Time, err error)
- func (w *LogParser) ParseURI(uri string, v map[string]interface{})
- func (w *LogParser) SetWorkChannel(channel chan map[string]interface{})
- func (w *LogParser) Start()
- func (w *LogParser) Stop()
- type StdOutWorker
- type Worker
Constants ¶
const DefaultParseLogPattern = `(?P<line>.*)` // `(?P<host>\S+) (?P<client>\S+) (?P<user>\S+) \[(?P<created>[^\]]+)\] "((?P<method>[A-Z]+) )?(?P<uri>\S+).*"`
DefaultParseLogPattern is the default pattern for understanding log patterns
Variables ¶
This section is empty.
Functions ¶
func ConfiguredElasticSearchDocumentType ¶
func ConfiguredElasticSearchDocumentType() string
func ConfiguredElasticSearchHosts ¶
func ConfiguredElasticSearchHosts() []string
func ConfiguredElasticSearchIndex ¶
func ConfiguredElasticSearchIndex() string
func ConfiguredElasticSearchMax ¶
func ConfiguredElasticSearchMax() int
func ConfiguredElasticSearchMocking ¶
func ConfiguredElasticSearchMocking() bool
func ConfiguredElasticSearchPort ¶
func ConfiguredElasticSearchPort() int
func ConfiguredElasticSearchReportEvery ¶
func ConfiguredElasticSearchReportEvery() int64
func ConfiguredElasticSearchScheme ¶
func ConfiguredElasticSearchScheme() string
func ConfiguredElasticSearchUseDateSuffix ¶
func ConfiguredElasticSearchUseDateSuffix() bool
func ConfiguredFileOutputName ¶
func ConfiguredFileOutputName() string
func EsSetDefaults ¶
func EsSetDefaults()
Types ¶
type ElasticSearchWorker ¶
type ElasticSearchWorker struct {
WorkChannel chan map[string]interface{}
QuitChannel chan bool
WorkerNumber int
// contains filtered or unexported fields
}
ElasticSearchWorker bulk uploads to ElasticSearch
func (*ElasticSearchWorker) CurrentCount ¶
func (w *ElasticSearchWorker) CurrentCount() int
func (*ElasticSearchWorker) CurrentItems ¶
func (w *ElasticSearchWorker) CurrentItems() []string
func (*ElasticSearchWorker) DocumentType ¶
func (w *ElasticSearchWorker) DocumentType() string
func (*ElasticSearchWorker) Endpoint ¶
func (w *ElasticSearchWorker) Endpoint() string
func (*ElasticSearchWorker) Index ¶
func (w *ElasticSearchWorker) Index() string
func (*ElasticSearchWorker) Init ¶
func (w *ElasticSearchWorker) Init() (err error)
func (*ElasticSearchWorker) Mocking ¶
func (w *ElasticSearchWorker) Mocking() bool
func (*ElasticSearchWorker) NextHost ¶
func (w *ElasticSearchWorker) NextHost() string
func (*ElasticSearchWorker) ReportEvery ¶
func (w *ElasticSearchWorker) ReportEvery() int64
func (*ElasticSearchWorker) SetWorkChannel ¶
func (w *ElasticSearchWorker) SetWorkChannel(channel chan map[string]interface{})
func (*ElasticSearchWorker) Stop ¶
func (w *ElasticSearchWorker) Stop()
Stop stops the w by send a message on its quit channel
func (*ElasticSearchWorker) UseDateSuffix ¶
func (w *ElasticSearchWorker) UseDateSuffix() bool
type FileWorker ¶
type FileWorker struct {
WorkChannel chan map[string]interface{}
QuitChannel chan bool
// contains filtered or unexported fields
}
func (*FileWorker) CachedFileHandle ¶
func (w *FileWorker) CachedFileHandle() *os.File
func (*FileWorker) Init ¶
func (w *FileWorker) Init() (err error)
func (*FileWorker) SetWorkChannel ¶
func (w *FileWorker) SetWorkChannel(channel chan map[string]interface{})
func (*FileWorker) Stop ¶
func (w *FileWorker) Stop()
Stop stops the worker by send a message on its quit channel
type LogParser ¶
type LogParser struct {
Channel chan map[string]interface{}
TimePatterns []string
Regex *regexp.Regexp
// contains filtered or unexported fields
}
LogParser parses the imput and puts events on a channel
func (*LogParser) ConfigureRegex ¶
func (w *LogParser) ConfigureRegex()
func (*LogParser) ParseEvents ¶
ParseEvents parses the line (including a call to ParseURI) to add events to the map of strings -> anything. It returns that map
func (*LogParser) ParseStringForValue ¶
func (*LogParser) ParseURI ¶
ParseURI parses the URI string and adds the relevant query parameters into the main map. it also attempts to determine the data type of the items by parsing as date, int, bool, float, and if all of these fail, then keeping as string
func (*LogParser) SetWorkChannel ¶
type StdOutWorker ¶
type StdOutWorker struct {
WorkChannel chan map[string]interface{}
QuitChannel chan bool
// contains filtered or unexported fields
}
func (*StdOutWorker) Init ¶
func (w *StdOutWorker) Init() (err error)
func (*StdOutWorker) SetWorkChannel ¶
func (w *StdOutWorker) SetWorkChannel(channel chan map[string]interface{})
func (*StdOutWorker) Stop ¶
func (w *StdOutWorker) Stop()
Stop stops the worker by send a message on its quit channel