Skip to content
This repository was archived by the owner on Mar 21, 2023. It is now read-only.

Commit 678841b

Browse files
joschiJochen Schalanda
authored andcommitted
Mark configuration settings in NetFlowCodec as optional (#13)
While these settings are in fact *not* optional, this seems to be the only way to make existing NetFlow inputs work with the newly added configuration settings without deleting and re-creating the inputs. Fixes #12 (cherry picked from commit cfbadbd)
1 parent 5e4174a commit 678841b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/org/graylog/plugins/netflow/codecs/NetFlowCodec.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.graylog2.plugin.Message;
2828
import org.graylog2.plugin.configuration.Configuration;
2929
import org.graylog2.plugin.configuration.ConfigurationRequest;
30+
import org.graylog2.plugin.configuration.fields.ConfigurationField;
3031
import org.graylog2.plugin.configuration.fields.NumberField;
3132
import org.graylog2.plugin.configuration.fields.TextField;
3233
import org.graylog2.plugin.inputs.annotations.Codec;
@@ -119,9 +120,9 @@ public void overrideDefaultValues(@Nonnull ConfigurationRequest cr) {
119120
public ConfigurationRequest getRequestedConfiguration() {
120121
final ConfigurationRequest configuration = super.getRequestedConfiguration();
121122

122-
configuration.addField(new NumberField(CK_CACHE_SIZE, "Maximum cache size", DEFAULT_CACHE_SIZE, "Maximum number of elements in the NetFlow9 template cache"));
123-
configuration.addField(new TextField(CK_CACHE_PATH, "Cache file path", DEFAULT_CACHE_PATH, "Path to the file persisting the the NetFlow9 template cache"));
124-
configuration.addField(new NumberField(CK_CACHE_SAVE_INTERVAL, "Cache save interval (seconds)", DEFAULT_CACHE_SAVE_INTERVAL, "Interval in seconds for persisting the cache contents"));
123+
configuration.addField(new NumberField(CK_CACHE_SIZE, "Maximum cache size", DEFAULT_CACHE_SIZE, "Maximum number of elements in the NetFlow9 template cache", ConfigurationField.Optional.OPTIONAL));
124+
configuration.addField(new TextField(CK_CACHE_PATH, "Cache file path", DEFAULT_CACHE_PATH, "Path to the file persisting the the NetFlow9 template cache", ConfigurationField.Optional.OPTIONAL));
125+
configuration.addField(new NumberField(CK_CACHE_SAVE_INTERVAL, "Cache save interval (seconds)", DEFAULT_CACHE_SAVE_INTERVAL, "Interval in seconds for persisting the cache contents", ConfigurationField.Optional.OPTIONAL));
125126

126127
return configuration;
127128
}

0 commit comments

Comments
 (0)