本文整理汇总了Java中org.graylog2.plugin.configuration.fields.NumberField类的典型用法代码示例。如果您正苦于以下问题:Java NumberField类的具体用法?Java NumberField怎么用?Java NumberField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NumberField类属于org.graylog2.plugin.configuration.fields包,在下文中一共展示了NumberField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
configurationRequest.addField(new TextField(CK_OUTPUT_FOLDER,
"Output folder in which the output file will be written.",
"/tmp/", "Output folder in which the output file will be written.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(CK_OUTPUT_FILE,
"File's name in which the output will be written",
"file_output",
"File's name in which the output will be written",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new NumberField(CK_FLUSH_TIME,
"Flush period time in seconds.",
15,
"Flush time period/interval",
ConfigurationField.Optional.NOT_OPTIONAL)
);
return configurationRequest;
}
示例2: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = ConfigurationRequest.createWithFields(
new TextField("query", "Query", "", "Query that should be checked", ConfigurationField.Optional.NOT_OPTIONAL),
new NumberField("time", "Time Range", 5, "Evaluate the condition for all messages received in the given number of minutes", ConfigurationField.Optional.NOT_OPTIONAL),
new DropdownField(
"threshold_type",
"Threshold Type",
ThresholdType.MORE.toString(),
Arrays.stream(ThresholdType.values()).collect(Collectors.toMap(Enum::toString, ThresholdType::getDescription)),
"Select condition to trigger alert: when there are more or less messages than the threshold",
ConfigurationField.Optional.NOT_OPTIONAL),
new NumberField("threshold", "Threshold", 0.0, "Value which triggers an alert if crossed", ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addFields(AbstractAlertCondition.getDefaultConfigurationFields());
return configurationRequest;
}
开发者ID:alcampos,项目名称:graylog-plugin-alert-conditional-count,代码行数:18,代码来源:ConditionalCountAlertCondition.java
示例3: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
configurationRequest.addField(new TextField(
CK_SPLUNK_HOST, "Splunk Host", "",
"Hostname or IP address of a Splunk instance",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new NumberField(
CK_SPLUNK_PORT, "Splunk Port", 12999,
"Port of a Splunk instance",
ConfigurationField.Optional.OPTIONAL)
);
final Map<String, String> protocols = ImmutableMap.of("TCP", "TCP");
configurationRequest.addField(new DropdownField(
CK_SPLUNK_PROTOCOL, "Splunk Protocol", "TCP", protocols,
"Protocol that should be used to send messages to Splunk",
ConfigurationField.Optional.OPTIONAL)
);
return configurationRequest;
}
示例4: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = ConfigurationRequest.createWithFields(
new TextField("query", "Query", "", "Query that should be checked", ConfigurationField.Optional.NOT_OPTIONAL),
new NumberField("backtime", "Back Time", 0, "Number of minutes to go back to the past to check the value", ConfigurationField.Optional.NOT_OPTIONAL),
new NumberField("staytime", "Stay Time", 1, "Number of minutes of the time to stay in the past", ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addFields(AbstractAlertCondition.getDefaultConfigurationFields());
return configurationRequest;
}
开发者ID:alcampos,项目名称:graylog-plugin-alert-condition-delorean,代码行数:11,代码来源:DeloreanAlertCondition.java
示例5: NsqClientConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
NsqClientConfiguration(Iterable<ConfigurationField> fields) {
addFields(
ImmutableList.<ConfigurationField>builder()
.addAll(fields)
.add(new TextField(
LOOKUPD_HTTP_ADDRESS,
"Lookupd HTTP addresses",
"http://localhost:4161",
"Lookupd HTTP addresses: http://host01:4161,http://host02:4161",
ConfigurationField.Optional.NOT_OPTIONAL))
.add(new TextField(TOPIC,
"Topic",
"graylog-nsq",
"topic with log lines",
ConfigurationField.Optional.NOT_OPTIONAL))
.add(new TextField(CHANNEL,
"CHANNEL",
String.format("set-your-channel-%s#ephemeral", RandomStringUtils.randomAlphanumeric(5)),
"channel for consumption. Default is emphemeral channel",
ConfigurationField.Optional.NOT_OPTIONAL))
.add(new NumberField(MAX_IN_FLIGHT,
"max in flight",
200,
"Max number of messages to allow in flight. Default: 200",
ConfigurationField.Optional.OPTIONAL))
.build()
);
}
示例6: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest cr = new ConfigurationRequest();
cr.addField(new TextField(CK_KEYSTORE_PATH,
"Keystore Path",
"",
"Absolute path of JKS keystore"));
cr.addField(new TextField(CK_KEYSTORE_PASSWORD,
"Keystore Password",
"",
"-deststorepass argument in keytool",
ConfigurationField.Optional.NOT_OPTIONAL,
TextField.Attribute.IS_PASSWORD));
cr.addField(new TextField(CK_KEY_PASSWORD,
"Key Password",
"",
"-destkeypass argument in keytool",
ConfigurationField.Optional.NOT_OPTIONAL,
TextField.Attribute.IS_PASSWORD));
cr.addField(new TextField(CK_BIND_IP,
"Bind IP Address",
"0.0.0.0",
"Local IP Address to bind",
ConfigurationField.Optional.NOT_OPTIONAL));
cr.addField(new NumberField(CK_BIND_PORT,
"Port",
5043,
"Local port to listen for events",
ConfigurationField.Optional.NOT_OPTIONAL,
NumberField.Attribute.IS_PORT_NUMBER));
return cr;
}
示例7: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest cr = new ConfigurationRequest();
cr.addField(new TextField(CK_BIND_IP,
"Bind IP Address",
"0.0.0.0",
"Local IP Address to bind",
ConfigurationField.Optional.NOT_OPTIONAL));
cr.addField(new NumberField(CK_BIND_PORT,
"Port",
5044,
"Local port to listen for events",
ConfigurationField.Optional.NOT_OPTIONAL,
NumberField.Attribute.IS_PORT_NUMBER));
cr.addField(new TextField(CK_KEYSTORE_PATH,
"Keystore Path",
"",
"Absolute path of JKS keystore",
ConfigurationField.Optional.OPTIONAL));
cr.addField(new TextField(CK_KEYSTORE_PASSWORD,
"Keystore Password",
"",
"-deststorepass argument in keytool",
ConfigurationField.Optional.OPTIONAL,
TextField.Attribute.IS_PASSWORD));
cr.addField(new TextField(CK_KEY_PASSWORD,
"Key Password",
"",
"-destkeypass argument in keytool",
ConfigurationField.Optional.OPTIONAL,
TextField.Attribute.IS_PASSWORD));
return cr;
}
示例8: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
configurationRequest.addField(new TextField(
CK_HOST,
"Host",
"localhost",
"host for tcp endpoint",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new NumberField(
CK_PORT,
"Port",
12300,
"The port on the host to connect to",
ConfigurationField.Optional.NOT_OPTIONAL,
NumberField.Attribute.ONLY_POSITIVE)
);
configurationRequest.addField(new NumberField(
CK_WORKERS,
"Number of Workers",
1,
"Number of workers to be instanciated",
ConfigurationField.Optional.NOT_OPTIONAL,
NumberField.Attribute.ONLY_POSITIVE)
);
return configurationRequest;
}
示例9: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest r = super.getRequestedConfiguration();
final Map<String, String> regions = Arrays.stream(Regions.values())
.collect(Collectors.toMap(Regions::getName, Regions::toString));
r.addField(new DropdownField(
CK_AWS_SQS_REGION,
"AWS SQS Region",
DEFAULT_REGION.getName(),
regions,
"The AWS region the SQS queue is in.",
ConfigurationField.Optional.NOT_OPTIONAL
));
r.addField(new DropdownField(
CK_AWS_S3_REGION,
"AWS S3 Region",
DEFAULT_REGION.getName(),
regions,
"The AWS region the S3 bucket containing logs is in.",
ConfigurationField.Optional.NOT_OPTIONAL
));
r.addField(new TextField(
CK_SQS_NAME,
"SQS queue name",
"s3-notifications",
"The SQS queue that SNS is writing S3 notifications to.",
ConfigurationField.Optional.NOT_OPTIONAL
));
r.addField(new TextField(
CK_ACCESS_KEY,
"AWS access key",
"",
"Access key of an AWS user with sufficient permissions. Leave blank to use Instance Profile Credentials. (See documentation)",
ConfigurationField.Optional.OPTIONAL,
TextField.Attribute.IS_PASSWORD
));
r.addField(new TextField(
CK_SECRET_KEY,
"AWS secret key",
"",
"Secret key of an AWS user with sufficient permissions. Leave blank to use Instance Profile Credentials. (See documentation)",
ConfigurationField.Optional.OPTIONAL,
TextField.Attribute.IS_PASSWORD
));
r.addField(new NumberField(
CK_THREAD_COUNT,
"Processing thread count",
10,
"Number of processing threads to pool for SQS/S3 reading",
ConfigurationField.Optional.NOT_OPTIONAL,
NumberField.Attribute.ONLY_POSITIVE
));
return r;
}
示例10: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
ConfigurationRequest configurationRequest = new ConfigurationRequest();
Map<String, String> formats = ImmutableMap.of("csv", "CSV", "tsv", "TSV", "pipe", "Pipe", "space", "Space");
configurationRequest.addField(new DropdownField(
"fileformat", "File Format", "csv", formats,
"The file format that should be used to write messages to disk.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField("filepath", "File Path", DEFAULTPATH,
"File path to write messages to. Available substitution variables are $HOST, $NODE, $EPOCH, $PID, $THREAD, $ROTATE, $PADDED.", ConfigurationField.Optional.NOT_OPTIONAL));
configurationRequest.addField(new TextField("fields", "Fields", DEFAULTFIELDS, "Comma separated fields to export.", ConfigurationField.Optional.NOT_OPTIONAL, TextField.Attribute.TEXTAREA));
Map<String, String> endlines = ImmutableMap.of("newline", "Newline", "crlf", "CRLF");
configurationRequest.addField(new DropdownField(
"endline", "End of Line", "newline", endlines,
"The special characters used by systems to represent end of line.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
Map<String, String> compresslist = ImmutableMap.of("none", "None", "gzip", "GZIP", "gzip_fast", "GZIP Fastest", "gzip_max", "GZIP Max Compression");
configurationRequest.addField(new DropdownField(
"compress", "Compression Options", "none", compresslist,
"Optionally compress the file in realtime.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
Map<String, String> strategies = ImmutableMap.of("interval", "Interval", "count", "Count");
configurationRequest.addField(new DropdownField(
"strategy", "Rotation Strategy", "interval", strategies,
"How the output filename will change to prevent unlimited growth.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new NumberField("rotateinterval", "Rotate Counter", DEFAULTROTATEINT, "Seconds or line count until file rotation, depending on selected strategy. Disable by setting to zero.", ConfigurationField.Optional.NOT_OPTIONAL, NumberField.Attribute.ONLY_POSITIVE));
configurationRequest.addField(new TextField("filedone", "Append Extension", DEFAULTDONE, "Append file with extension when rotating.", ConfigurationField.Optional.OPTIONAL));
configurationRequest.addField(new NumberField("buffersize", "Buffer Size", DEFAULTBUFFER, "Write buffer in bytes. Must be greater than zero, multiple of 1024 recommended.", ConfigurationField.Optional.NOT_OPTIONAL, NumberField.Attribute.ONLY_POSITIVE));
configurationRequest.addField(new NumberField("flushinterval", "Flush Interval", DEFAULTINTERVAL, "Seconds to flush write buffer. Disable by setting to zero.", ConfigurationField.Optional.NOT_OPTIONAL, NumberField.Attribute.ONLY_POSITIVE));
configurationRequest.addField(new BooleanField("debug", "Debug", false, "Enable debugging to troubleshoot file writes."));
return configurationRequest;
}
开发者ID:rswestmoreland,项目名称:graylog-delimited-file-output-plugin,代码行数:47,代码来源:DelimitedFileOutput.java
示例11: RedisClientConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
RedisClientConfiguration(Iterable<ConfigurationField> fields) {
addFields(
ImmutableList.<ConfigurationField>builder()
.addAll(fields)
.add(new TextField(CK_REDIS_URI,
"Redis URI",
"redis://localhost",
"URI of the Redis server: redis://[[email protected]]host[:port][/databaseNumber]",
ConfigurationField.Optional.NOT_OPTIONAL))
.add(new NumberField(CK_TIMEOUT,
"Timeout (s)",
60,
"Timeout for the Redis client in seconds",
ConfigurationField.Optional.NOT_OPTIONAL))
.add(new NumberField(CK_THREADS_IO,
"I/O threads",
Math.max(DefaultClientResources.MIN_IO_THREADS, DefaultClientResources.DEFAULT_IO_THREADS),
"Number of I/O threads",
ConfigurationField.Optional.OPTIONAL,
NumberField.Attribute.ONLY_POSITIVE))
.add(new NumberField(CK_THREADS_COMPUTATION,
"Computation threads",
Math.max(DefaultClientResources.MIN_COMPUTATION_THREADS, DefaultClientResources.DEFAULT_COMPUTATION_THREADS),
"Number of computation threads",
ConfigurationField.Optional.OPTIONAL,
NumberField.Attribute.ONLY_POSITIVE))
.add(new NumberField(CK_REQUEST_QUEUE_SIZE,
"Request queue size",
ClientOptions.DEFAULT_REQUEST_QUEUE_SIZE,
"Request queue size per connection",
ConfigurationField.Optional.OPTIONAL,
NumberField.Attribute.ONLY_POSITIVE))
.add(new BooleanField(CK_AUTO_RECONNECT,
"Automatic reconnect",
ClientOptions.DEFAULT_AUTO_RECONNECT,
"Try to reconnect and re-issue any queued commands if connection was involuntarily closed"))
.add(new BooleanField(CK_PING_BEFORE_ACTIVATE_CONNECTION,
"Ping before use",
ClientOptions.DEFAULT_PING_BEFORE_ACTIVATE_CONNECTION,
"Enable initial PING barrier before any connection is usable"))
.build()
);
}
示例12: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
configurationRequest.addField(new TextField(CK_REST_URL, "URL to Rest API", "https://localhost:8181/alertflex-ctrl/webresources/alert", "", ConfigurationField.Optional.NOT_OPTIONAL));
configurationRequest.addField(new TextField(CK_REST_USER, "user", "admin", "", ConfigurationField.Optional.NOT_OPTIONAL));
configurationRequest.addField(new TextField(CK_REST_PWD, "password", "", "", ConfigurationField.Optional.NOT_OPTIONAL));
configurationRequest.addField(new NumberField(CK_EVENT_ID, "event ID", 1, "", ConfigurationField.Optional.NOT_OPTIONAL));
configurationRequest.addField(new NumberField(CK_SEVERITY, "severity", 1, "", ConfigurationField.Optional.NOT_OPTIONAL));
configurationRequest.addField(new TextField(CK_CATEGORY, "category", "Graylog alarm callback", "", ConfigurationField.Optional.NOT_OPTIONAL));
configurationRequest.addField(new TextField(CK_INFO, "info", "Alert info", "", ConfigurationField.Optional.NOT_OPTIONAL));
return configurationRequest;
}
示例13: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
configurationRequest.addField(new TextField(
CK_HDFS_HOST_NAME,
"Host",
"",
"IP Address or hostname of HDFS server",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new NumberField(
CK_HDFS_PORT,
"Port",
50070,
"HDFS Web Port",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_USERNAME,
"Username",
"",
"User name for WebHDFS connection",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_FILE,
"File path",
"",
"Path of file to write messages." +
"Accepts message fields like ${source} or date formats like %Y_%m_%d_%H_%M",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_MESSAGE_FORMAT,
"Message Format",
"${timestamp} | ${source} | ${message}",
"Format of the message to be written. Use message fields to format",
ConfigurationField.Optional.OPTIONAL)
);
configurationRequest.addField(new NumberField(
CK_FLUSH_INTERVAL,
"Flush Interval",
0,
"Flush interval in seconds. Recommended for high throughput outputs. 0 for immediate update",
ConfigurationField.Optional.NOT_OPTIONAL)
);
return configurationRequest;
}
示例14: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
configurationRequest.addField(new TextField(
CK_URL,
"URL of metrics endpoint",
"graphite://localhost:2003",
"URL of your Graphite/Ganglia/StatsD instance",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_PREFIX,
"Prefix for metric names",
"org.graylog",
"Metric name will be 'prefix + field name'.",
ConfigurationField.Optional.OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_FIELDS,
"Message fields to submit to the metrics store",
"response_time,db_time,view_time",
"A comma separated list of message field names that should be transmitted as gauge values." +
"Types like counter, meter, histogram can be set like: cache_hit:counter",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new NumberField(
CK_RUN_RATE,
"Submission frequency (seconds)",
30,
"The period (in seconds) at which Graylog will submit metrics to the endpoint. " +
"Keep this number high to not flood the metrics store.",
ConfigurationField.Optional.NOT_OPTIONAL,
NumberField.Attribute.ONLY_POSITIVE)
);
configurationRequest.addField(new TextField(
CK_INCLUDE_FIELD_VALUE,
"Append the value of the given field to the end of the metric name.",
"",
"Metric name will be 'prefix + field name + value of another field'.",
ConfigurationField.Optional.OPTIONAL)
);
configurationRequest.addField(new BooleanField(
CK_INCLUDE_SOURCE,
"Include message source in metric name",
false,
"Metric name will be 'prefix + source + field name'.")
);
configurationRequest.addField(new BooleanField(
CK_INCLUDE_TYPE,
"Include field type in metric name",
false,
"Metric name will be 'prefix + field name + type'.")
);
return configurationRequest;
}
示例15: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.NumberField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration()
{
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
configurationRequest.addField(new TextField(
CONFIG_AUTH_TOKEN, "Clickatell AuthToken", "",
"AuthenticationToken for the Clickatell REST API",
ConfigurationField.Optional.NOT_OPTIONAL,
TextField.Attribute.IS_PASSWORD)
);
configurationRequest.addField(new TextField(
CONFIG_RECIPIENTS, "Recipients of short message", "",
"Comma separated list of number in international format, eg 27999112345. No '00', ' ', '+' or '-', just numbers",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new BooleanField(
CONFIG_RESULT_DESCRIPTION, "Include result description in short message", true,
"Set to true to include result description in short message, or set to false to omit result description.")
);
configurationRequest.addField(new TextField(
CONFIG_FIELDS, "Fields to send in short message", "",
"Comma separated list of fields to send as message text, eg <message>, <id>, <timestamp>, <source>, <stream> or user defined fields. Built-in fields have to be surrounded by '<>'",
ConfigurationField.Optional.OPTIONAL)
);
configurationRequest.addField(new BooleanField(
CONFIG_INCLUDE_FIELD_NAMES, "Include field names in short message", true,
"Set to true to include field names in short message, or set to false to omit field names and only send field contents.")
);
configurationRequest.addField(new NumberField(
CONFIG_MAX_LENGTH, "MaxLength", 0,
"Maximum length of short message",
ConfigurationField.Optional.OPTIONAL)
);
configurationRequest.addField(new NumberField(
CONFIG_MAX_CREDITS, "MaxCredits", 0,
"Maximum credits to spend on a short message",
ConfigurationField.Optional.OPTIONAL)
);
configurationRequest.addField(new NumberField(
CONFIG_MAX_PARTS, "MaxParts", 0,
"Maximum number of parts a short message can consist of",
ConfigurationField.Optional.OPTIONAL)
);
configurationRequest.addField(new TextField(
CONFIG_STATIC_TEXT, "Static text that prepends the short message", "",
"You can optionally define a phrase that will be sent with every short message.",
ConfigurationField.Optional.OPTIONAL)
);
return configurationRequest;
}