Commit ca0afd55 authored by Xavier Guimard's avatar Xavier Guimard

Fix IP bad filter (#354)

parent 122d9157
......@@ -42,6 +42,7 @@ foreach my $i ( 1 .. COUNT() ) {
$hour = int( rand($hour) );
$min = int( rand(60) );
$sec = int( rand(60) );
my $ipAddr = join('.',int(rand(256)),int(rand(256)),int(rand(256)),int(rand(256)));
my $req = Test::Request->new(
{
sessionInfo => {
......@@ -56,6 +57,7 @@ foreach my $i ( 1 .. COUNT() ) {
$sec, $min, $hour, $mday, $mon,
$year, $wday, $yday, $isdst
),
ipAddr => $ipAddr,
}
}
);
......
......@@ -136,6 +136,7 @@ sub sessions {
delete $filters{$firstFilter};
foreach my $k ( keys %filters ) {
$self->logger->debug("Removing unless $k =~ /^$filters{$k}\$/");
$filters{$k} =~ s/\./\\./g;
$filters{$k} =~ s/\*/\.\*/g;
foreach my $session ( keys %$res ) {
if ( $res->{$session}->{$k} ) {
......
......@@ -20,11 +20,11 @@ schemes =
(t,v) ->
"groupBy=net4(#{t},1)"
(t,v) ->
"#{t}=#{v}*&groupBy=net4(#{t},2)"
"#{t}=#{v}.*&groupBy=net4(#{t},2)"
(t,v) ->
"#{t}=#{v}*&groupBy=net4(#{t},3)"
"#{t}=#{v}.*&groupBy=net4(#{t},3)"
(t,v) ->
"#{t}=#{v}&groupBy=net4(#{t},4)"
"#{t}=#{v}.*&groupBy=net4(#{t},4)"
(t,v) ->
"#{t}=#{v}&groupBy=_whatToTrace"
(t,v,q) ->
......
......@@ -23,11 +23,11 @@
function(t, v) {
return "groupBy=net4(" + t + ",1)";
}, function(t, v) {
return t + "=" + v + "*&groupBy=net4(" + t + ",2)";
return t + "=" + v + ".*&groupBy=net4(" + t + ",2)";
}, function(t, v) {
return t + "=" + v + "*&groupBy=net4(" + t + ",3)";
return t + "=" + v + ".*&groupBy=net4(" + t + ",3)";
}, function(t, v) {
return t + "=" + v + "&groupBy=net4(" + t + ",4)";
return t + "=" + v + ".*&groupBy=net4(" + t + ",4)";
}, function(t, v) {
return t + "=" + v + "&groupBy=_whatToTrace";
}, function(t, v, q) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment