Apache Seatunnel-Sink plugin : Elasticsearch [Spark]

作者: Apache Seatunnel

输出数据到Elasticsearch,支持的ElasticSearch版本为 >= 2.x 且 < 7.0.0。

Options

nametyperequireddefault value
[hosts] hosts-array   
[index_type] index_type-string   
[index_time_format] index_time_format-string   
[index] index-string   
[es] es-string   
[common-options] common-options-string   
hosts [array]

Elasticsearch集群地址,格式为host:port,允许指定多个host。如[“host1:9200”, “host2:9200”]。

index_type [string]

Elasticsearch index type

index_time_format [string]

index参数中的格式为xxxx-${now}时,index_time_format可以指定index名称的时间格式,默认值为 yyyy.MM.dd。常用的时间格式列举如下:

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

详细的时间格式语法见Java SimpleDateFormat

index [string]

Elasticsearch index名称,如果需要根据时间生成index,可以指定时间变量,如:seatunnel-${now}now代表当前数据处理的时间。

es.* [string]

用户还可以指定多个非必须参数,详细的参数列表见Elasticsearch支持的参数.

如指定es.batch.size.entries的方式是: es.batch.size.entries = 100000。如果不指定这些非必须参数,它们将使用官方文档给出的默认值。

common options [string]

Sink 插件通用参数,详情参照 [Sink Plugin]

Examples

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

将结果写入Elasticsearch集群的名称为seatunnel的index中

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

按天创建索引,例如 seatunnel-2020.01.01

文章列表

更多推荐

更多
这里什么都没有

近期文章

更多
文章目录

    推荐作者

    更多