blob: 5d187049f266e6e3a9efeb5f3baa01fe18c6903f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* Fluent Bit
* ==========
* Copyright (C) 2015-2022 The Fluent Bit Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FLB_OUT_ES_H
#define FLB_OUT_ES_H
#define FLB_ES_DEFAULT_HOST "127.0.0.1"
#define FLB_ES_DEFAULT_PORT 92000
#define FLB_ES_DEFAULT_INDEX "fluent-bit"
#define FLB_ES_DEFAULT_TYPE "_doc"
#define FLB_ES_DEFAULT_PREFIX "logstash"
#define FLB_ES_DEFAULT_TIME_FMT "%Y.%m.%d"
#define FLB_ES_DEFAULT_TIME_KEY "@timestamp"
#define FLB_ES_DEFAULT_TIME_KEYF "%Y-%m-%dT%H:%M:%S"
#define FLB_ES_DEFAULT_TAG_KEY "flb-key"
#define FLB_ES_DEFAULT_HTTP_MAX "512k"
#define FLB_ES_DEFAULT_HTTPS_PORT 443
#define FLB_ES_WRITE_OP_INDEX "index"
#define FLB_ES_WRITE_OP_CREATE "create"
#define FLB_ES_WRITE_OP_UPDATE "update"
#define FLB_ES_WRITE_OP_UPSERT "upsert"
struct flb_elasticsearch {
/* Elasticsearch index (database) and type (table) */
char *index;
char *type;
char suppress_type_name;
/* HTTP Auth */
char *http_user;
char *http_passwd;
/* Elastic Cloud Auth */
char *cloud_user;
char *cloud_passwd;
/* AWS Auth */
#ifdef FLB_HAVE_AWS
int has_aws_auth;
char *aws_region;
char *aws_sts_endpoint;
char *aws_profile;
struct flb_aws_provider *aws_provider;
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
/* HTTP Client Setup */
size_t buffer_size;
/*
* If enabled, replace field name dots with underscore, required for
* Elasticsearch 2.0-2.3.
*/
int replace_dots;
int trace_output;
int trace_error;
/*
* Logstash compatibility options
* ==============================
*/
/* enabled/disabled */
int logstash_format;
int generate_id;
int current_time_index;
/* prefix */
flb_sds_t logstash_prefix;
flb_sds_t logstash_prefix_separator;
/* prefix key */
flb_sds_t logstash_prefix_key;
/* date format */
flb_sds_t logstash_dateformat;
/* time key */
flb_sds_t time_key;
/* time key format */
flb_sds_t time_key_format;
/* time key nanoseconds */
int time_key_nanos;
/* write operation */
flb_sds_t write_operation;
/* write operation elasticsearch operation */
flb_sds_t es_action;
/* id_key */
flb_sds_t id_key;
struct flb_record_accessor *ra_id_key;
/* include_tag_key */
int include_tag_key;
flb_sds_t tag_key;
/* Elasticsearch HTTP API */
char uri[256];
struct flb_record_accessor *ra_prefix_key;
/* Compression mode (gzip) */
int compress_gzip;
/* Upstream connection to the backend server */
struct flb_upstream *u;
/* Plugin output instance reference */
struct flb_output_instance *ins;
};
#endif
|