@@ -26,6 +26,8 @@ namespace logs
26
26
*/
27
27
struct ElasticsearchExporterOptions
28
28
{
29
+ using HttpHeaders = std::multimap<std::string, std::string>;
30
+
29
31
// Configuration options to establish Elasticsearch connection
30
32
std::string host_;
31
33
int port_;
@@ -37,6 +39,9 @@ struct ElasticsearchExporterOptions
37
39
// Whether to print the status of the exporter in the console
38
40
bool console_debug_;
39
41
42
+ /* * Additional HTTP headers. */
43
+ HttpHeaders http_headers_;
44
+
40
45
/* *
41
46
* Constructor for the ElasticsearchExporterOptions. By default, the endpoint is
42
47
* localhost:9200/logs with a timeout of 30 seconds and disabled console debugging
@@ -47,16 +52,18 @@ struct ElasticsearchExporterOptions
47
52
* from elasticsearch
48
53
* @param console_debug If true, print the status of the exporter methods in the console
49
54
*/
50
- ElasticsearchExporterOptions (std::string host = " localhost" ,
51
- int port = 9200 ,
52
- std::string index = " logs" ,
53
- int response_timeout = 30 ,
54
- bool console_debug = false )
55
+ ElasticsearchExporterOptions (std::string host = " localhost" ,
56
+ int port = 9200 ,
57
+ std::string index = " logs" ,
58
+ int response_timeout = 30 ,
59
+ bool console_debug = false ,
60
+ HttpHeaders http_headers = {})
55
61
: host_{host},
56
62
port_{port},
57
63
index_{index},
58
64
response_timeout_{response_timeout},
59
- console_debug_{console_debug}
65
+ console_debug_{console_debug},
66
+ http_headers_{http_headers}
60
67
{}
61
68
};
62
69
0 commit comments