Documentation
¶
Index ¶
Constants ¶
View Source
const (
NDJSONContentType = "application/x-ndjson"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
//> @3@4@5@6
//>
//> The list of elasticsearch endpoints in the following format: `SCHEMA://HOST:PORT`
Endpoints []string `json:"endpoints" required:"true"` //*
//> @3@4@5@6
//>
//> Username for HTTP Basic Authentication.
Username string `json:"username"` //*
//> @3@4@5@6
//>
//> Password for HTTP Basic Authentication.
Password string `json:"password"` //*
//> @3@4@5@6
//>
//> Base64-encoded token for authorization; if set, overrides username/password.
APIKey string `json:"api_key"` //*
//> @3@4@5@6
//> Path or content of a PEM-encoded CA file.
CACert string `json:"ca_cert"` //*
//> @3@4@5@6
//>
//> It defines the pattern of elasticsearch index name. Use `%` character as a placeholder. Use `index_values` to define values for the replacement.
//> E.g. if `index_format="my-index-%-%"` and `index_values="service,@@time"` and event is `{"service"="my-service"}`
//> then index for that event will be `my-index-my-service-2020-01-05`. First `%` replaced with `service` field of the event and the second
//> replaced with current time(see `time_format` option)
IndexFormat string `json:"index_format" default:"file-d-%"` //*
//> @3@4@5@6
//>
//> A comma-separated list of event fields which will be used for replacement `index_format`.
//> There is a special field `@@time` which equals the current time. Use the `time_format` to define a time format.
//> E.g. `[service, @@time]`
IndexValues []string `json:"index_values" default:"[@time]" slice:"true"` //*
//> @3@4@5@6
//>
//> The time format pattern to use as value for the `@@time` placeholder.
//> > Check out [func Parse doc](https://golang.org/pkg/time/#Parse) for details.
TimeFormat string `json:"time_format" default:"2006-01-02"` //*
//> @3@4@5@6
//>
//> It defines how much time to wait for the connection.
ConnectionTimeout cfg.Duration `json:"connection_timeout" default:"5s" parse:"duration"` //*
ConnectionTimeout_ time.Duration
//> @3@4@5@6
//>
//> It defines how many workers will be instantiated to send batches.
WorkersCount cfg.Expression `json:"workers_count" default:"gomaxprocs*4" parse:"expression"` //*
WorkersCount_ int
//> @3@4@5@6
//>
//> A maximum quantity of events to pack into one batch.
BatchSize cfg.Expression `json:"batch_size" default:"capacity/4" parse:"expression"` //*
BatchSize_ int
//> @3@4@5@6
//>
//> After this timeout batch will be sent even if batch isn't full.
BatchFlushTimeout cfg.Duration `json:"batch_flush_timeout" default:"200ms" parse:"duration"` //*
BatchFlushTimeout_ time.Duration
}
! config-params ^ config-params
Click to show internal directories.
Click to hide internal directories.