Skip to content

Commit f2df1ce

Browse files
committed
feat: load host IP from proxied source IP (#2566)
1 parent 579f989 commit f2df1ce

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

package/etc/conf.d/conflib/_splunk/splunkfields.conf

+5
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,8 @@ filter f_is_source_identified{
128128
filter f_is_agg{
129129
tags("agg");
130130
};
131+
132+
filter f_is_proxy_ip{
133+
"$HOST" eq "$SOURCEIP"
134+
and "$PROXIED_SRCIP" ne ""
135+
};

package/etc/conf.d/sources/internal.conf

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ source s_internal {
114114
or match("Syslog connection closed; fd=" value("MESSAGE"))
115115
or match("Syslog connection accepted; fd=" value("MESSAGE"))
116116
or match("xml-parser failed; " value("MESSAGE"))
117+
or match("Initializing PROXY protocol source driver" value("MESSAGE"))
117118
};
118119
rewrite(r_set_dest_splunk_null_queue);
119120
};

package/etc/conf.d/sources/source_syslog/plugin.jinja

+14
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ source s_{{ port_id }} {
114114
);
115115
};
116116
{%- endif %}
117+
118+
{%- if use_proxy_connect == True %}
119+
rewrite {
120+
set("$PROXIED_SRCIP", value("HOST") condition(filter(f_is_proxy_ip)) );
121+
};
122+
{%- endif %}
123+
117124
if {
118125
if {
119126
parser {
@@ -396,6 +403,13 @@ source s_{{ port_id }} {
396403
{%- endif %}
397404
{%- endfor %}
398405
};
406+
407+
{%- if use_proxy_connect == True %}
408+
rewrite {
409+
set("$PROXIED_SRCIP", value("HOST") condition(filter(f_is_proxy_ip)) );
410+
};
411+
{%- endif %}
412+
399413
{%- if vendor and product %}
400414
parser {
401415
p_set_netsource_fields(

0 commit comments

Comments
 (0)