elasticsearch

Use Elasticsearch sink to send data to Elasticsearch cluster.

Example

  1. sink:
  2. type: elasticsearch
  3. hosts: ["elasticsearch1:9200", "elasticsearch2:9200", "elasticsearch3:9200"]
  4. index: "log-${fields.service}-${+YYYY.MM.DD}"

hosts

fieldtyperequireddefaultdescription
hostsstring arraytruenoneelasticsearch addresses

index

fieldtyperequireddefaultdescription
indexstringtruenonethe index of elasticsearch storage data

You can use ${a.b} to obtain fields in the log data, or add ${+YYYY.MM.DD.hh} timestamps to dynamically generate indexes.

username

fieldtyperequireddefaultdescription
usernamestringfalsenoneIf Elasticsearch is configured with username and password authentication, you need to fill in the requested username.

password

fieldtyperequireddefaultdescription
passwordstringfalsenoneIf Elasticsearch is configured with username and password authentication, you need to fill in the requested password.

schema

fieldtyperequireddefaultdescription
schemastringfalsehttpused for client sniffing

sniff

fieldtyperequireddefaultdescription
sniffboolfalsefalsewhether to enable sniffer

gzip

fieldtyperequireddefaultdescription
gzipboolfalsefalsewhether to enable gzip compression for sending data

documentId

fieldtyperequireddefaultdescription
documentIdstringfalseThe id value sent to elasticsearch, which can be extracted from a field by ${}.