8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/fluent/plugin/filter_wms_auth.rb', line 8
def filter(tag, time, record)
record['host'.freeze] = HOST
path = record['path'.freeze] or return
if path.sub! /wmsAuthSign=([^&]+)&?/, ''.freeze
id,cookie,_ = Base64.decode64($1)[/id=([^&]+)/, 1].split('+'.freeze,3)
record['user_id'.freeze] = id.to_i unless id.empty?
record['cookie'.freeze] = cookie
end
if path.sub! /nimblesessionid=([^&]+)&?/, ''.freeze
record['nimble_session_id'.freeze] = $1
end
record
end
|