Skip to content

Commit

Permalink
resolve PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Katherine Shen <katshen@amazon.com>
  • Loading branch information
shenkw1 committed Nov 1, 2024
1 parent 79cf00a commit 2968a0d
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class FlattenProcessorConfig {
@JsonPropertyDescription("The target key to put into the flattened fields. If set to an empty string (<code>\"\"</code>) " +
"then the processor uses the root of the event as the target.")
@ExampleValues({
@Example(value = "flattened-key2", description = "The flattened fields from the source key specified are put into the specified target key.")
@Example(value = "flattened-key2", description = "The flattened fields from the source key specified are put into a field named 'flattened-key2'.")
})
private String target;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,17 @@ public class EntryConfig {
@JsonPropertyDescription("The key of the source field containing the IP address to geolocate.")
@JsonProperty("source")
@NotEmpty
@ExampleValues({
@Example(value = "clientip", description = "The processor will extract available geolocation data from the IP address provided in the field named 'clientip'")
})
private String source;

@JsonPropertyDescription("The key of the target field in which to set the geolocation data.")
@JsonProperty(value = "target", defaultValue = DEFAULT_TARGET)
@ExampleValues({
@Example(value = "clientlocation", description = "The processor will put the geolocation data into a field named 'clientlocation'")
})
private String target = DEFAULT_TARGET;

@JsonPropertyDescription("The list of geolocation fields to include in the target object. By default, this is all the fields provided by the configured databases. " +
"For example, if you wish to only obtain the actual location, you can specify <code>location</code>.")
@JsonProperty("include_fields")
@ExampleValues({
@Example(value = "[asn, asn_organization, network]", description = "The processor will include these fields while extracting geolocation data.")
@Example(value = "[location, latitude, longitude]", description = "The processor will include these fields while extracting geolocation data.")
})
private List<String> includeFields;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,14 @@ public class GeoIPProcessorConfig {

@JsonProperty("tags_on_engine_failure")
@JsonPropertyDescription("The tags to add to the event metadata if the <code>geoip</code> processor is unable to enrich an event due to an engine failure.")
@ExampleValues({
@Example(value = "_engine_failure", description = "Events are tagged with this string when the processor failures to extract geolocation data.")
})
private List<String> tagsOnEngineFailure;

@JsonProperty("tags_on_ip_not_found")
@JsonPropertyDescription("The tags to add to the event metadata if the <code>geoip</code> processor is unable to find a location for a valid IP address.")
@ExampleValues({
@Example(value = "_ip_not_found", description = "Events are tagged with this string when a location is not found for a valid IP address.")
})
private List<String> tagsOnIPNotFound;

@JsonProperty("tags_on_no_valid_ip")
@JsonPropertyDescription("The tags to add to the event metadata if the source field is not a valid IP address. A source field may not be valid because it is incorrectly formatted or is the loopback/localhost IP address.")
@ExampleValues({
@Example(value = "_invalid_ip", description = "Events are tagged with this string when the IP address is invalid.")
})
private List<String> tagsOnNoValidIp;

@JsonProperty("geoip_when")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,12 @@ public class KeyValueProcessorConfig {
@NotEmpty
@JsonProperty(defaultValue = DEFAULT_SOURCE)
@JsonPropertyDescription("The source field to parse for key-value pairs. The default value is <code>message</code>.")
@ExampleValues({
@Example(value = "message1", description = "{\"message1\": {\"key1=value1\"}, \"message2\": {\"key2=value2\"}} parses into " +
"{\"message1\": {\"key1=value1\"}, \"message2\": {\"key2=value2\"}, \"parsed_message\": {\"key1\": \"value1\"}}.")
})
private String source = DEFAULT_SOURCE;

@JsonProperty(defaultValue = DEFAULT_DESTINATION)
@JsonPropertyDescription("The destination field for the structured data. The destination will be a structured map with the key value pairs extracted from the source. " +
"If <code>destination</code> is set to <code>null</code>, the parsed fields will be written to the root of the event. " +
"The default value is <code>parsed_message</code>.")
@ExampleValues({
@Example(value = "parsed_data", description = "{\"message\": {\"key1=value1\"}} parses into " +
"{\"message\": {\"key1=value1\"}, \"parsed_data\": {\"key1\": \"value1\"}}.")
})
private String destination = DEFAULT_DESTINATION;

@JsonProperty(value = FIELD_SPLIT_CHARACTERS_KEY, defaultValue = DEFAULT_FIELD_SPLIT_CHARACTERS)
Expand Down Expand Up @@ -121,9 +113,6 @@ public class KeyValueProcessorConfig {
"If the key was parsed from the source field that value will remain and the default value is not used. " +
"If the default values includes keys which are not part of <code>include_keys</code> those keys and value will be added to the event.")
@NotNull
@ExampleValues({
@Example(value = "{\"defaultkey\": \"defaultvalue\"}", description = "key1=value1 will parse into {\"key1\": \"value1\", \"defaultkey\": \"defaultvalue\"}.")
})
private Map<String, Object> defaultValues = DEFAULT_DEFAULT_VALUES;

@JsonProperty("non_match_value")
Expand All @@ -139,23 +128,17 @@ public class KeyValueProcessorConfig {
@JsonPropertyDescription("An array specifying the keys that should be included in the destination field. " +
"By default, all keys will be added.")
@NotNull
@ExampleValues({
@Example(value = "[\"key2\"]", description = "key1=value1&key2=value2 will parse into {\"key2\": \"value2\"}.")
})
private List<String> includeKeys = DEFAULT_INCLUDE_KEYS;

@JsonProperty(value = "exclude_keys", defaultValue = "[]")
@JsonPropertyDescription("An array specifying the parsed keys that should be excluded from the destination field. " +
"By default, no keys will be excluded.")
@NotNull
@ExampleValues({
@Example(value = "[\"key2\"]", description = "key1=value1&key2=value2 will parse into {\"key1\": \"value1\"}.")
})
private List<String> excludeKeys = DEFAULT_EXCLUDE_KEYS;

@JsonPropertyDescription("A prefix to append before all keys. By default no prefix is added.")
@ExampleValues({
@Example(value = "custom", description = "{\"key1=value1\"} parses into {\"customkey1\": \"value1\"}.")
@Example(value = "query:", description = "{\"key1=value1\"} parses into {\"query:key1\": \"value1\"}.")
})
private String prefix = null;

Expand All @@ -181,11 +164,6 @@ public class KeyValueProcessorConfig {

@JsonProperty(value = "transform_key", defaultValue = "none")
@JsonPropertyDescription("Allows transforming the key's name such as making the name all lowercase.")
@ExampleValues({
@Example(value = "lowercase", description = "{\"Key1=value1\"} will parse into {\"key1\": \"value1\"}."),
@Example(value = "uppercase", description = "{\"key1=value1\"} will parse into {\"KEY1\": \"value1\"}."),
@Example(value = "capitalize", description = "{\"key1=value1\"} will parse into {\"Key1\": \"value1\"}.")
})
private TransformOption transformKey = TransformOption.NONE;

@JsonProperty(value = WHITESPACE_KEY, defaultValue = "lenient")
Expand Down Expand Up @@ -275,9 +253,6 @@ public class KeyValueProcessorConfig {

@JsonProperty("tags_on_failure")
@JsonPropertyDescription("The tags to add to the event metadata if the <code>key_value</code> processor fails to parse the source string.")
@ExampleValues({
@Example(value = "[\"keyvalueprocessor_failure\"]", description = "{\"tags\": [\"keyvalueprocessor_failure\"]} will be added to the event’s metadata in the event of a runtime exception.")
})
private List<String> tagsOnFailure;

@JsonProperty("key_value_when")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,11 @@ public String getOptionValue() {
@NotNull
@JsonProperty("source")
@JsonPropertyDescription("The list of objects with <code>key</code> fields to be converted into keys for the generated map.")
@ExampleValues({
@Example(value = "mylist", description = "The key 'mylist' will have a list of objects as its value to be converted into a map.")
})
private String source;

@JsonProperty("target")
@JsonPropertyDescription("The target for the generated map. When not specified, the generated map will be " +
"placed in the root node.")
@ExampleValues({
@Example(value = "result", description = "The generated map will be placed at the 'result' node.")
})
private String target = null;

@JsonProperty("use_source_key")
Expand All @@ -90,9 +84,6 @@ public String getOptionValue() {
@JsonProperty("key")
@JsonPropertyDescription("The key of the fields to be extracted as keys in the generated mappings. Must be " +
"specified if <code>use_source_key</code> is <code>false</code>.")
@ExampleValues({
@Example(value = "name", description = "In each list object, 'name' will be extracted and used as the key in the generated map.")
})
private String key;

@JsonProperty("value_key")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,12 @@ public class MapToListProcessorConfig {
@JsonProperty("source")
@JsonPropertyDescription("The source map used to perform the mapping operation. When set to an empty " +
"string (<code>\"\"</code>), it will use the root of the event as the <code>source</code>.")
@ExampleValues({
@Example(value = "mymap", description = "The key 'mymap' will have a map of objects as its value to be converted into a list.")
})
private String source;

@NotEmpty
@NotNull
@JsonProperty("target")
@JsonPropertyDescription("The target for the generated list.")
@ExampleValues({
@Example(value = "mylist", description = "The generated list will be placed at the 'mylist' node.")
})
private String target;

@JsonProperty(value = "key_name", defaultValue = DEFAULT_KEY_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class ObfuscationProcessorConfig {
@JsonProperty("patterns")
@JsonPropertyDescription("A list of regex patterns that allow you to obfuscate specific parts of a field. Only parts that match the regex pattern will obfuscate. When not provided, the processor obfuscates the whole field.")
@ExampleValues({
@Example(value = "[\"[A-Za-z0-9+_.-]+@([\\w-]+\\.)+[\\w-]{2,4}\"]", description = "This pattern represents an email address that will be obfuscated in the given field.")
@Example(value = "[A-Za-z0-9+_.-]+@([\\w-]+\\.)+[\\w-]{2,4}", description = "This pattern represents an email address that will be obfuscated in the given field.")
})
private List<String> patterns;

Expand Down

0 comments on commit 2968a0d

Please sign in to comment.