diff --git a/pom.xml b/pom.xml index d0666d5..cb7f96b 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.graylog.plugins.aggregates graylog-plugin-aggregates - 0.0.12 + 0.0.13 jar ${project.artifactId} diff --git a/src/main/java/org/graylog/plugins/aggregates/AggregatesMetaData.java b/src/main/java/org/graylog/plugins/aggregates/AggregatesMetaData.java index 60b0c55..d743520 100644 --- a/src/main/java/org/graylog/plugins/aggregates/AggregatesMetaData.java +++ b/src/main/java/org/graylog/plugins/aggregates/AggregatesMetaData.java @@ -34,7 +34,7 @@ public URI getURL() { @Override public Version getVersion() { - return new Version(0, 0, 12); + return new Version(0, 0, 13); } @Override diff --git a/src/main/java/org/graylog/plugins/aggregates/rule/alert/RuleAlertSender.java b/src/main/java/org/graylog/plugins/aggregates/rule/alert/RuleAlertSender.java index 32a4d70..e2569f3 100644 --- a/src/main/java/org/graylog/plugins/aggregates/rule/alert/RuleAlertSender.java +++ b/src/main/java/org/graylog/plugins/aggregates/rule/alert/RuleAlertSender.java @@ -135,7 +135,13 @@ protected String buildSummary(Rule rule, Map matchedTerms, TimeRan sb.append("").append(entry.getValue()).append(""); try { - String search_uri="/search?rangetype=absolute&fields=message%2Csource%2C"+rule.getField()+"&from="+timeRange.getFrom()+"&to="+timeRange.getTo()+"&q="+URLEncoder.encode(rule.getQuery()+" AND " + rule.getField()+":\""+entry.getKey()+"\"", "UTF-8"); + String streamId = rule.getStreamId(); + String search_uri = ""; + + if (streamId != null && streamId != ""){ + search_uri+="/streams/"+streamId; + } + search_uri+="/search?rangetype=absolute&fields=message%2Csource%2C"+rule.getField()+"&from="+timeRange.getFrom()+"&to="+timeRange.getTo()+"&q="+URLEncoder.encode(rule.getQuery()+" AND " + rule.getField()+":\""+entry.getKey()+"\"", "UTF-8"); sb.append("").append("Search").append(""); } catch (UnsupportedEncodingException e) { sb.append("").append("Unable to URL encode search URI").append("");