Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions plugins/in_splunk/splunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,16 @@ static struct flb_config_map config_map[] = {
0, FLB_TRUE, offsetof(struct flb_splunk, tag_key),
"Set a record key to specify the tag of the record"
},
{
FLB_CONFIG_MAP_BOOL, "add_remote_addr", "false",
0, FLB_TRUE, offsetof(struct flb_splunk, add_remote_addr),
"Inject a remote address using the X-Forwarded-For header or connection address"
},
{
FLB_CONFIG_MAP_STR, "remote_addr_key", "remote_addr",
0, FLB_TRUE, offsetof(struct flb_splunk, remote_addr_key),
"Set a record key for storing the remote address"
},


/* EOF */
Expand Down
6 changes: 6 additions & 0 deletions plugins/in_splunk/splunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ struct flb_splunk {
size_t ingested_auth_header_len;
int store_token_in_metadata;
flb_sds_t store_token_key;
int add_remote_addr;
flb_sds_t remote_addr_key;

struct flb_log_event_encoder log_encoder;

Expand All @@ -71,6 +73,10 @@ struct flb_splunk {
struct flb_downstream *downstream; /* Client manager */
struct mk_list connections; /* linked list of connections */
struct mk_server *server;

/* Remote address */
flb_sds_t current_remote_addr;
size_t current_remote_addr_len;
};


Expand Down
3 changes: 3 additions & 0 deletions plugins/in_splunk/splunk_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ struct flb_splunk *splunk_config_create(struct flb_input_instance *ins)

ctx->ingested_auth_header = NULL;

ctx->current_remote_addr = NULL;
ctx->current_remote_addr_len = 0;

ret = setup_hec_tokens(ctx);
if (ret != 0) {
splunk_config_destroy(ctx);
Expand Down
Loading
Loading