Documentation ¶
Index ¶
- Constants
- func InitHandler(context.Context, config.ConfigRaw) (config.TypeCodecConfig, error)
- type Codec
- func (c *Codec) Decode(ctx context.Context, data any, eventExtra map[string]any, tags []string, ...) (ok bool, err error)
- func (c *Codec) DecodeEvent(data []byte, event *logevent.LogEvent) (err error)
- func (c *Codec) Encode(ctx context.Context, event logevent.LogEvent, dataChan chan<- []byte) (ok bool, err error)
Constants ¶
View Source
const ErrorTag = "gogstash_codec_json_error"
ErrorTag tag added to event when process module failed
View Source
const ModuleName = "json"
ModuleName is the name used in config file
Variables ¶
This section is empty.
Functions ¶
func InitHandler ¶
InitHandler initialize the codec plugin
Types ¶
type Codec ¶
type Codec struct {
config.CodecConfig
}
Codec default struct for codec
func (*Codec) Decode ¶
func (c *Codec) Decode(ctx context.Context, data any, eventExtra map[string]any, tags []string, msgChan chan<- logevent.LogEvent) (ok bool, err error)
Decode returns an event from 'data' as JSON format, adding provided 'eventExtra'
func (*Codec) DecodeEvent ¶
DecodeEvent decodes 'data' as JSON format to event
Click to show internal directories.
Click to hide internal directories.