Skip to main content
Version: 1.x

Elasticsearch

Output plugin : Elasticsearch​

Description​

Write Rows to Elasticsearch. Support Elasticsearch >= 2.X

Options​

nametyperequireddefault value
hostsarrayyes-
index_typestringno_doc
index_time_formatstringnoyyyy.MM.dd
indexstringnoseatunnel
esstringno-
hosts [array]​

Elasticsearch hosts, format as host:port. For example, ["host1:9200", "host2:9200"]

index_type [string]​

Elasticsearch index type

index_time_format [string]​

Elasticsearch time format. If index likes xxxx-${now}, index_time_format can be used to specify the format of index, default is yyyy.MM.dd. The commonly used time formats are listed below:

SymbolDescription
yYear
MMonth
dDay of month
HHour in day (0-23)
mMinute in hour
sSecond in minute

The detailed time format syntax:Java SimpleDateFormat.

index [string]​

Elasticsearch index name, if you want to generate index based on time, you need to specify the field like seatunnel-${now}. now means current time.

es.* [string]​

You can also specify multiple Elasticsearch's parameters described in [Elasticsearch Configuration](https://www.elastic.co/guide/en/elasticsearch/hadoop/current/configuration.html#cfg-mapping.

The way to specify parameters is to use the prefix "es" before the parameter. For example, batch.size.entries is specified as: es.batch.size.entries = 1000.If you do not specify these parameters, it will be set the default values according to Elasticsearch documentation

Examples​

elasticsearch {
hosts = ["localhost:9200"]
index = "seatunnel"
}

Index name is seatunnel

elasticsearch {
hosts = ["localhost:9200"]
index = "seatunnel-${now}"
es.batch.size.entries = 100000
index_time_format = "yyyy.MM.dd"
}

Create index by day. For example: seatunnel-2017.11.03