Skip to content

Commit

Permalink
Changed Exclude Filter Strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelenglert committed Apr 23, 2018
1 parent 2871f29 commit 5cacdb6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Version 1.2.3

* Changed Exclude Filter Strategy

### Version 1.2.2

* Fixed config.yml change bug
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.appdynamics.monitors</groupId>
<artifactId>azure-monitoring-extension</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static Map<String,String> getResourceFilter(JsonNode filtersJson) {
static Boolean checkResourceFilter(JsonNode jsonNode, Map<String,String> resourceFilter){
for(Map.Entry<String, String> entry : resourceFilter.entrySet()){
if(jsonNode.get("resourceId").asText().contains(entry.getKey())){
if (jsonNode.get("name").get("value").asText().matches(entry.getValue())){
if (jsonNode.get("id").asText().matches(entry.getValue())){
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/conf/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ monitor-api-version: "2017-05-01-preview"
keyvault-api-version: "2016-10-01"

# Include Filter - These Resource Types will be monitored:
# The exclude Element will ignore by matching the regular expression against the Metric Name from the Metric Definition Response
# The exclude Element will ignore by matching the regular expression against the Metric Definition ID from the Metric Definition Response
filter:
- resourceType: "Microsoft.AnalysisServices/servers"
# exclude: ".*"
Expand Down

0 comments on commit 5cacdb6

Please sign in to comment.