Added asset filter in http visit definition.
This commit is contained in:
parent
f1361c9d25
commit
2e59500d69
1 changed files with 5 additions and 1 deletions
|
@ -21,6 +21,7 @@ package fr.devinsy.statoolinfos.metrics.http;
|
|||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -35,6 +36,8 @@ public class HttpAccessLog
|
|||
{
|
||||
private static Logger logger = LoggerFactory.getLogger(HttpAccessLog.class);
|
||||
|
||||
public static final Pattern ASSET_PATTERN = Pattern.compile("^.*\\.(avi|css|gif|ico|jpeg|jpg|js|mp3|mp4|ogg|png|svg|wav) HTTP.*$");
|
||||
|
||||
private String ip;
|
||||
private String remoteUser;
|
||||
private LocalDateTime time;
|
||||
|
@ -240,7 +243,8 @@ public class HttpAccessLog
|
|||
{
|
||||
boolean result;
|
||||
|
||||
if ((this.status.getCategory() == HttpStatusCategory.SUCCESS) && (!isBot()) && (this.request.startsWith("GET ")))
|
||||
if ((this.status.getCategory() == HttpStatusCategory.SUCCESS) && (!isBot()) && (this.request.startsWith("GET ")) &&
|
||||
(!ASSET_PATTERN.matcher(this.request).matches()))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue