Skip to content

Commit

Permalink
change default aggregation key
Browse files Browse the repository at this point in the history
  • Loading branch information
brettlangdon committed Apr 11, 2016
1 parent 5d338e8 commit 9f447e4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/io/underdog/GraylogPluginDatadog.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ public void write(Message message) throws Exception {
if (aggregationKey != "") {
payload.put("aggregation_key", aggregationKey);
} else {
payload.put("aggregation_key", message.getSource());
final StringBuilder sb = new StringBuilder();
sb.append(message.getSource());
if (message.getField("facility") != null) {
sb.append("_").append(message.getField("facility"));
}
payload.put("aggregation_key", sb.toString());
}

Response response = eventTarget
Expand Down Expand Up @@ -195,7 +200,7 @@ public ConfigurationRequest getRequestedConfiguration() {

configurationRequest.addField(new TextField(
CK_DATADOG_AGGREGATION_KEY, "Datadog event aggregation key", "",
"Datadog event custom aggregation key [default: message source]",
"Datadog event custom aggregation key [default: '[source]_[facility]']",
ConfigurationField.Optional.OPTIONAL)
);

Expand Down

0 comments on commit 9f447e4

Please sign in to comment.