Documentation
¶
Index ¶
- Constants
- Variables
- func Compile(pattern string, patterns *Patterns) (*oniguruma.Regex, error)
- func NewBufferLoadMetric(log logrus.FieldLogger, lineLimitSet bool) *bufferLoadMetric
- func RunHttpServer(host string, port int, httpHandlers []HttpServerPathHandler) error
- func RunHttpsServer(host string, port int, cert string, key string, ...) error
- func RunHttpsServerWithDefaultKeys(host string, port int, httpHandlers []HttpServerPathHandler) error
- func VerifyFieldNames(m *v2.MetricConfig, regex, deleteRegex *oniguruma.Regex) error
- func VersionString() string
- type HttpServerPathHandler
- type LabelValueTracker
- type Match
- type Metric
- func NewCounterMetric(cfg *configuration.MetricConfig, regex *oniguruma.Regex, ...) Metric
- func NewGaugeMetric(cfg *configuration.MetricConfig, regex *oniguruma.Regex, ...) Metric
- func NewHistogramMetric(cfg *configuration.MetricConfig, regex *oniguruma.Regex, ...) Metric
- func NewSummaryMetric(cfg *configuration.MetricConfig, regex *oniguruma.Regex, ...) Metric
- type Patterns
Constants ¶
View Source
const PATTERN_RE = `%{(.+?)}`
PATTERN_RE matches the %{..} patterns. There are three possibilities: 1) %{USER} - grok pattern 2) %{IP:clientip} - grok pattern with name 3) %{INT:clientport:int} - grok pattern with name and type (type is currently ignored)
Variables ¶
View Source
var ( Version string BuildDate string Branch string Revision string GoVersion = runtime.Version() Platform = runtime.GOOS + "-" + runtime.GOARCH )
The following strings are populated during build time with release.sh: go build -ldflags "-X importpath.name=value"
Functions ¶
func NewBufferLoadMetric ¶ added in v0.2.8
func NewBufferLoadMetric(log logrus.FieldLogger, lineLimitSet bool) *bufferLoadMetric
func RunHttpServer ¶
func RunHttpServer(host string, port int, httpHandlers []HttpServerPathHandler) error
func RunHttpsServer ¶
func RunHttpsServerWithDefaultKeys ¶
func RunHttpsServerWithDefaultKeys(host string, port int, httpHandlers []HttpServerPathHandler) error
func VerifyFieldNames ¶
func VerifyFieldNames(m *v2.MetricConfig, regex, deleteRegex *oniguruma.Regex) error
func VersionString ¶
func VersionString() string
Types ¶
type HttpServerPathHandler ¶ added in v0.2.8
type LabelValueTracker ¶ added in v0.2.2
type LabelValueTracker interface { Observe(labels map[string]string) (bool, error) DeleteByLabels(labels map[string]string) ([]map[string]string, error) DeleteByRetention(retention time.Duration) []map[string]string }
Keep track of labels values for a metric.
func NewLabelValueTracker ¶ added in v0.2.2
func NewLabelValueTracker(labelNames []string) LabelValueTracker
type Metric ¶
type Metric interface { Name() string Collector() prometheus.Collector // Returns the match if the line matched, and nil if the line didn't match. ProcessMatch(line string) (*Match, error) // Returns the match if the delete pattern matched, nil otherwise. ProcessDeleteMatch(line string) (*Match, error) // Remove old metrics ProcessRetention() error }
func NewCounterMetric ¶
func NewCounterMetric(cfg *configuration.MetricConfig, regex *oniguruma.Regex, deleteRegex *oniguruma.Regex) Metric
func NewGaugeMetric ¶
func NewGaugeMetric(cfg *configuration.MetricConfig, regex *oniguruma.Regex, deleteRegex *oniguruma.Regex) Metric
func NewHistogramMetric ¶
func NewHistogramMetric(cfg *configuration.MetricConfig, regex *oniguruma.Regex, deleteRegex *oniguruma.Regex) Metric
func NewSummaryMetric ¶
func NewSummaryMetric(cfg *configuration.MetricConfig, regex *oniguruma.Regex, deleteRegex *oniguruma.Regex) Metric
type Patterns ¶
func InitPatterns ¶
func InitPatterns() *Patterns
func (*Patterns) AddFile ¶
pattern files see https://github.com/logstash-plugins/logstash-patterns-core/tree/master/patterns
func (*Patterns) AddPattern ¶
Click to show internal directories.
Click to hide internal directories.