Skip to content

Commit

Permalink
feat: load host IP from proxied source IP (#2566)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstopa-splunk committed Sep 26, 2024
1 parent 7dec478 commit 538be9b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions package/etc/conf.d/conflib/_splunk/splunkfields.conf
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,8 @@ filter f_is_source_identified{
filter f_is_agg{
tags("agg");
};

filter f_is_proxy_ip{
"$HOST" eq "$SOURCEIP"
and "$PROXIED_SRCIP" ne ""
};
1 change: 1 addition & 0 deletions package/etc/conf.d/sources/internal.conf
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ source s_internal {
or match("Syslog connection closed; fd=" value("MESSAGE"))
or match("Syslog connection accepted; fd=" value("MESSAGE"))
or match("xml-parser failed; " value("MESSAGE"))
or match("Initializing PROXY protocol source driver" value("MESSAGE"))
};
rewrite(r_set_dest_splunk_null_queue);
};
Expand Down
14 changes: 14 additions & 0 deletions package/etc/conf.d/sources/source_syslog/plugin.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ source s_{{ port_id }} {
);
};
{%- endif %}

{%- if use_proxy_connect == True %}
rewrite {
set("$PROXIED_SRCIP", value("HOST") condition(filter(f_is_proxy_ip)) );
};
{%- endif %}

if {
if {
parser {
Expand Down Expand Up @@ -396,6 +403,13 @@ source s_{{ port_id }} {
{%- endif %}
{%- endfor %}
};

{%- if use_proxy_connect == True %}
rewrite {
set("$PROXIED_SRCIP", value("HOST") condition(filter(f_is_proxy_ip)) );
};
{%- endif %}

{%- if vendor and product %}
parser {
p_set_netsource_fields(
Expand Down

0 comments on commit 538be9b

Please sign in to comment.