Documentation ¶
Overview ¶
Package elasticsearch provides a client for the Elasticsearch. Features: - Message's content by default is JSON-formatted. - Provides multiple ways to set the index name: static, or dynamic - which is evaluated at index time.
NOTE: It's the caller's responsibility to create the index, define its mapping, and settings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamicIndexFunc ¶ added in v1.6.3
type DynamicIndexFunc func() string
DynamicIndexFunc is a function which defines the name of the index, and evaluated at the index time.
type ElasticSearch ¶
type ElasticSearch struct { // Client is the ElasticSearch client. Client *elasticsearch.Client // Config is the ElasticSearch configuration. Config Config // DynamicIndex is a function which defines the name of the index, and // evaluated at the index time. DynamicIndex DynamicIndexFunc }
ElasticSearch `Output` definition.
func New ¶
func New( indexName string, esConfig Config, ) *ElasticSearch
New returns a new `ElasticSearch` client.
func NewWithDynamicIndex ¶ added in v1.6.3
func NewWithDynamicIndex( dynamicIndexFunc DynamicIndexFunc, esConfig Config, ) *ElasticSearch
NewWithDynamicIndex returns a new `ElasticSearch` client. It allows to define is a function which defines the name of the index, and evaluated at the index time.