Skip to content

Commit

Permalink
pipeline: outputs: es: basic support of Upstream, only parameters kno…
Browse files Browse the repository at this point in the history
…wn to parser of Upstream node configuration section are implemented, e.g. "host" and "port"

Signed-off-by: Marat Abrarov <[email protected]>
  • Loading branch information
mabrarov committed Nov 29, 2024
1 parent 4acffc2 commit 00bc2a1
Show file tree
Hide file tree
Showing 7 changed files with 867 additions and 529 deletions.
1 change: 1 addition & 0 deletions plugins/out_es/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set(src
es_bulk.c
es_conf_parse.c
es_conf.c
es.c
murmur3.c)
Expand Down
309 changes: 182 additions & 127 deletions plugins/out_es/es.c

Large diffs are not rendered by default.

25 changes: 19 additions & 6 deletions plugins/out_es/es.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
#ifndef FLB_OUT_ES_H
#define FLB_OUT_ES_H

#include <monkey/mk_core/mk_list.h>
#include <fluent-bit/flb_sds.h>

#define FLB_ES_DEFAULT_HOST "127.0.0.1"
#define FLB_ES_DEFAULT_PORT 92000
#define FLB_ES_DEFAULT_PORT 9200
#define FLB_ES_DEFAULT_INDEX "fluent-bit"
#define FLB_ES_DEFAULT_TYPE "_doc"
#define FLB_ES_DEFAULT_PREFIX "logstash"
Expand All @@ -45,10 +48,12 @@
#define FLB_ES_STATUS_DUPLICATES (1 << 6)
#define FLB_ES_STATUS_ERROR (1 << 7)

struct flb_elasticsearch {
struct flb_elasticsearch_config {
/* Elasticsearch index (database) and type (table) */
char *index;
int own_index;
char *type;
int own_type;
int suppress_type_name;

/* HTTP Auth */
Expand All @@ -69,9 +74,7 @@ struct flb_elasticsearch {
struct flb_aws_provider *base_aws_provider;
/* tls instances can't be re-used; aws provider requires a separate one */
struct flb_tls *aws_tls;
/* one for the standard chain provider, one for sts assume role */
struct flb_tls *aws_sts_tls;
char *aws_session_name;
char *aws_service_name;
struct mk_list *aws_unsigned_headers;
#endif
Expand Down Expand Up @@ -117,7 +120,6 @@ struct flb_elasticsearch {
/* time key nanoseconds */
int time_key_nanos;


/* write operation */
flb_sds_t write_operation;
/* write operation elasticsearch operation */
Expand All @@ -139,8 +141,19 @@ struct flb_elasticsearch {
/* Compression mode (gzip) */
int compress_gzip;

/* Upstream connection to the backend server */
/* List entry data for flb_elasticsearch->configs list */
struct mk_list _head;
};

struct flb_elasticsearch {
/* if HA mode is enabled */
int ha_mode; /* High Availability mode enabled ? */
char *ha_upstream; /* Upstream configuration file */
struct flb_upstream_ha *ha;

/* Upstream handler and config context for single mode (no HA) */
struct flb_upstream *u;
struct mk_list configs;

/* Plugin output instance reference */
struct flb_output_instance *ins;
Expand Down
Loading

0 comments on commit 00bc2a1

Please sign in to comment.