Skip to content

Commit 124dc48

Browse files
committed
update for utf-8 geoip fix
update for utf-8 geoip fix
1 parent f91ad6a commit 124dc48

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

logstash-modsecurity.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,12 @@ filter {
388388
source => "XForwardedFor"
389389
target => "XForwardedFor-GEOIP"
390390
}
391+
392+
# Optional, if not fixed: massage values to UTF-8... hack @see https://logstash.jira.com/browse/LOGSTASH-1372
393+
# convert Strings to UTF-8, leave as-is otherwise
394+
#ruby {
395+
# code => "geoip = event.to_hash['XForwardedFor-GEOIP']; if !geoip.nil?; newgeoip = Hash.new(); geoip.each do |key,value|; if !value.nil? and value.is_a? String; newgeoip[key] = value.encode('UTF-8'); else; newgeoip[key] = value; end; end; event.to_hash.merge!('XForwardedFor-GEOIP' => newgeoip); end;"
396+
#}
391397

392398

393399
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)