Repository navigation
Senders
Many output can batch events for improved performance. A batching output will use the following arguments:
-
batchSize, batch size -
workers, the number of concurrent batches can be flushed at the same time -
flushInterval, how often to flush a batch, even if not full.
Some senders do their own encoding, the other needs an explicit encoder, whose setup is provided in the encoder attribute.
It can batch and does not need an encoder.
-
destinations, an array of Elastic servers. -
port, the port for Elasticsearch server, default to 9200. -
protocol, http or https, default to https. -
user, username for authentication. -
password, password for authentication. -
timeout, timeout for requests, in seconds, default to 2. -
index, an expression for the index name. -
dateformat, a date format pattern, that can be used to generate index name; used only if index expression is not defined. -
type, an expression for the_typevalue; default to_doc. -
templateName, the name for the index template; default tologhub. -
templatePath, the path to the index template file; iftemplateNameis null, template handling is disabled. -
withTemplate,falsedisable any template handling from LogHub. -
typeHandling, can take the values USING, MIGRATING, DEPRECATED; default toUSING.- USING means the old
_typefield is still used. - MIGRATING means the old
_typeis still used, but the parameterinclude_type_name=trueis added when needed. - DEPRECATED means that no
_typeis used, in template handling or bulk send. So bothtypeandtypeXsettings will be ignored.
- USING means the old
-
ilm, activate the index lifecycle management (ILM) feature; if true, index existence will be checked, and it’s missing, a new index with the nameindexname-000001will be created, and an alias toindexnamewill be added; default tofalse. -
pipeline, the name of the ingest pipeline to use; default to none. -
clusterName, the name of the cluster, used for display or JMX metrics; default to none. -
elasticArguments, a map of additional arguments to pass to the Elasticsearch bulk request. It can take expression, but they are not resolved against an event, as it’s used for the bulk request. -
statusCheck, check the status of the Elasticsearch cluster before sending; default totrue.
If neither type or typeX is defined, the type of documents defaults to _doc, unless of course if typeHandling is defined to DEPRECATED, in which case it's ignored.
The settings elasticArguments and statusCheck can be used to send logs to VictoriaMetrics using an Elasticsearch data
ingester, see Logstash Setup, but
with minor differences. One should then add the following settings for compatibility.
loghub.senders.ElasticSearch {
...
statusCheck: false,
elasticArguments: {
"_msg_field": "message",
"_time_field": "@timestamp",
"_stream_fields": "host.name,process.name",
}
It can batch. If batching, the file on disk might be in an inconsistent state, with events missing and holes in the file, until a batch is totally committed to disk.
-
fileName, an expression for the filename, -
cacheSize, if the filename is an expression, a cache should be used to avoid constant reopening of the same files, defines the open cache size; default to 10 entries. -
truncate, truncate before opening a file if it already exists. -
separator, the entry separator, as a String.
It does not need an encoder.
It can batch. When batching, each batch will use a dedicated socket, to the same destination.
-
destination, -
port, -
separator, the entry separator, as a String
It can batch.
-
type, a ZMQ socket type. hwm-
destination, a ZMQ URL. -
method, can beBINDorCONNECT. serverKey-
security, can beNULL,PLAIN,CURVE. -
zapHandler, can beALLOW,DENY,STRICT,METADATA.