Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: load host IP from proxied source IP #2566

Merged
merged 3 commits into from
Sep 26, 2024
Merged
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
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 @@ -391,6 +398,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
Loading