Documentation ¶
Overview ¶
Package schema contains helper utilities to parse, convert, rename, and reorganize data from the format returned by the various monitored systems to the data model used by Metricbeat.
See the docs in the mapstrstr and mapstriface sub-packages for usage examples.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conv ¶
type Conv struct { Func Converter // Convertor function Key string // The key in the data map Optional bool // Whether to log errors if the key is not found }
A Conv object represents a conversion mechanism from the data map to the event map.
func Optional ¶
The optional flag suppresses the error message in case the key doesn't exist or results in an error.
func SetOptions ¶
func SetOptions(c Conv, opts []SchemaOption) Conv
setOptions adds the optional flags to the Conv object
type Mapper ¶
type Mapper interface { // Map applies the Mapper conversion on the data and adds the result // to the event on the key. Map(key string, event common.MapStr, data map[string]interface{}) *Errors HasKey(key string) bool }
Mapper interface represents a valid type to be used in a schema.
type Schema ¶
Schema describes how a map[string]interface{} object can be parsed and converted into an event. The conversions can be described using an (optionally nested) common.MapStr that contains Conv objects.
func (Schema) Apply ¶
Apply converts the fields extracted from data, using the schema, into a new map and reports back the errors.
type SchemaOption ¶
SchemaOption is for adding optional parameters to the conversion functions
Directories ¶
Path | Synopsis |
---|---|
Package mapstriface contains utilities for transforming map[string]interface{} objects into metricbeat events.
|
Package mapstriface contains utilities for transforming map[string]interface{} objects into metricbeat events. |
Package mapstrstr contains utilities for transforming map[string]string objects into metricbeat events.
|
Package mapstrstr contains utilities for transforming map[string]string objects into metricbeat events. |