2020#ifndef FLB_OUT_ES_H
2121#define FLB_OUT_ES_H
2222
23+ #include <monkey/mk_core/mk_list.h>
24+ #include <fluent-bit/flb_sds.h>
25+
2326#define FLB_ES_DEFAULT_HOST "127.0.0.1"
24- #define FLB_ES_DEFAULT_PORT 92000
27+ #define FLB_ES_DEFAULT_PORT 9200
2528#define FLB_ES_DEFAULT_INDEX "fluent-bit"
2629#define FLB_ES_DEFAULT_TYPE "_doc"
2730#define FLB_ES_DEFAULT_PREFIX "logstash"
3639#define FLB_ES_WRITE_OP_UPDATE "update"
3740#define FLB_ES_WRITE_OP_UPSERT "upsert"
3841
39- struct flb_elasticsearch {
42+ struct flb_elasticsearch_config {
4043 /* Elasticsearch index (database) and type (table) */
4144 char * index ;
45+ int own_index ;
4246 char * type ;
47+ int own_type ;
4348 char suppress_type_name ;
4449
4550 /* HTTP Auth */
@@ -60,9 +65,7 @@ struct flb_elasticsearch {
6065 struct flb_aws_provider * base_aws_provider ;
6166 /* tls instances can't be re-used; aws provider requires a separate one */
6267 struct flb_tls * aws_tls ;
63- /* one for the standard chain provider, one for sts assume role */
6468 struct flb_tls * aws_sts_tls ;
65- char * aws_session_name ;
6669 char * aws_service_name ;
6770 struct mk_list * aws_unsigned_headers ;
6871#endif
@@ -108,7 +111,6 @@ struct flb_elasticsearch {
108111 /* time key nanoseconds */
109112 int time_key_nanos ;
110113
111-
112114 /* write operation */
113115 flb_sds_t write_operation ;
114116 /* write operation elasticsearch operation */
@@ -130,8 +132,19 @@ struct flb_elasticsearch {
130132 /* Compression mode (gzip) */
131133 int compress_gzip ;
132134
133- /* Upstream connection to the backend server */
135+ /* List entry data for flb_elasticsearch->configs list */
136+ struct mk_list _head ;
137+ };
138+
139+ struct flb_elasticsearch {
140+ /* if HA mode is enabled */
141+ int ha_mode ; /* High Availability mode enabled ? */
142+ char * ha_upstream ; /* Upstream configuration file */
143+ struct flb_upstream_ha * ha ;
144+
145+ /* Upstream handler and config context for single mode (no HA) */
134146 struct flb_upstream * u ;
147+ struct mk_list configs ;
135148
136149 /* Plugin output instance reference */
137150 struct flb_output_instance * ins ;
0 commit comments