Skip to content

Commit 110a11f

Browse files
committed
ref(logging): improve filter matching logic in ElasticsearchBackendClient
Signed-off-by: Johnny Hujol <itudoben@users.noreply.github.com>
1 parent b10a53e commit 110a11f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/io/github/delirius325/jmeter/backendlistener/elasticsearch/ElasticsearchBackendClient.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,13 @@ private boolean validateSample(BackendListenerContext context, SampleResult sr)
317317

318318
if (!this.filters.isEmpty()) {
319319
for (String filter : filters) {
320-
Pattern pattern = Pattern.compile(filter);
320+
Pattern pattern = Pattern.compile(String.format(".*%s.*", filter));
321321
Matcher matcher = pattern.matcher(sampleLabel);
322322

323-
if (!sampleLabel.startsWith("!!") && (sampleLabel.contains(filter) || matcher.find())) {
324-
valid = true;
323+
if (matcher.find()) {
324+
// README.md#Features*Filters
325+
// You can also choose to exclude certain samplers; `!!exclude_this;filter1;filter2`
326+
valid = !sampleLabel.startsWith("!!");
325327
break;
326328
}
327329
else {

0 commit comments

Comments
 (0)