本文整理汇总了Java中org.graylog2.plugin.configuration.fields.DropdownField类的典型用法代码示例。如果您正苦于以下问题:Java DropdownField类的具体用法?Java DropdownField怎么用?Java DropdownField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DropdownField类属于org.graylog2.plugin.configuration.fields包,在下文中一共展示了DropdownField类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.DropdownField; //导入依赖的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
示例2: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.DropdownField; //导入依赖的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;
}
开发者ID:graylog-labs,项目名称:graylog-plugin-splunk,代码行数:26,代码来源:SplunkOutput.java
示例3: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.DropdownField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final Map<String, String> pipelineOptions = this.pipelineService.loadAll().stream()
.sorted((o1, o2) -> o1.title().compareTo(o2.title()))
.collect(Collectors.toMap(PipelineDao::id, PipelineDao::title));
return new ConfigurationRequest() {{
addField(new DropdownField(CONFIG_FIELD_PIPELINE,
"Pipeline",
"",
pipelineOptions,
"Which pipeline to use for message decoration",
ConfigurationField.Optional.NOT_OPTIONAL));
}};
}
开发者ID:Graylog2,项目名称:graylog-plugin-pipeline-processor,代码行数:15,代码来源:PipelineProcessorMessageDecorator.java
示例4: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.DropdownField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
final SortedMap<String, String> levels = ImmutableSortedMap
.<String, String>orderedBy((o1, o2) -> Level.getLevel(o1).compareTo(Level.getLevel(o2)))
.put(Level.OFF.name(), Level.OFF.name())
.put(Level.FATAL.name(), Level.FATAL.name())
.put(Level.ERROR.name(), Level.ERROR.name())
.put(Level.WARN.name(), Level.WARN.name())
.put(Level.INFO.name(), Level.INFO.name())
.put(Level.DEBUG.name(), Level.DEBUG.name())
.put(Level.TRACE.name(), Level.TRACE.name())
.put(Level.ALL.name(), Level.ALL.name())
.build();
configurationRequest.addField(
new DropdownField(
CK_LEVEL_THRESHOLD,
"Level threshold",
Level.INFO.name(),
levels,
"Defines the minimum log level for internal log messages which should be logged.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
return configurationRequest;
}
开发者ID:graylog-labs,项目名称:graylog-plugin-internal-logs,代码行数:28,代码来源:SerializedLogEventTransport.java
示例5: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.DropdownField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
configurationRequest.addField(new TextField(
CK_API_TOKEN, "Room Token", "", "HipChat room token",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_ROOM, "Room", "", "ID or name of HipChat room",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new DropdownField(
CK_COLOR, "Color", "yellow", VALID_COLORS,
"Background color for message", ConfigurationField.Optional.OPTIONAL)
);
configurationRequest.addField(new BooleanField(
CK_NOTIFY, "Notify", true, "Whether this message should trigger a user notification."));
configurationRequest.addField(new TextField(
CK_API_URL, "HipChat API URL", "https://api.hipchat.com",
"Specify different API URL for self hosted HipChat", ConfigurationField.Optional.OPTIONAL));
configurationRequest.addField(new TextField(
CK_GRAYLOG_BASE_URL, "Graylog Base URL", "",
"Graylog base URL for linking to the stream (e.g. https://your.graylogserver.com).", ConfigurationField.Optional.OPTIONAL));
configurationRequest.addField(new TextField(
CK_MESSAGE_TEMPLATE, "Message Template", "",
"Custom message template (same as email templates).", ConfigurationField.Optional.OPTIONAL, TextField.Attribute.TEXTAREA));
return configurationRequest;
}
开发者ID:graylog-labs,项目名称:graylog-plugin-hipchat,代码行数:31,代码来源:HipChatAlarmCallback.java
示例6: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.DropdownField; //导入依赖的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;
}
开发者ID:sherzberg,项目名称:graylog-plugin-s3,代码行数:63,代码来源:S3Transport.java
示例7: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.DropdownField; //导入依赖的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
示例8: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.DropdownField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
final Map<String, String> protocols = ImmutableMap.of(
"HTTP", "HTTP",
"Bolt", "Bolt");
configurationRequest.addField(new DropdownField(
CK_PROTOCOL, "Neo4J Protocol", "HTTP", protocols,
"The protocol used to connect to Neo4J",
ConfigurationField.Optional.NOT_OPTIONAL));
configurationRequest.addField(new TextField(
CK_NEO4J_URL, "Neo4j URL", "http://localhost:7474/db/data",
"default for Bolt: bolt://localhost:7687/",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_NEO4J_STARTUP_QUERY, "Startup Cypher query", "CREATE INDEX ON :HOST(address)",
"Query will be executed only once at start up time",
ConfigurationField.Optional.OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_NEO4J_QUERY, "Cypher query",
"MERGE (source:HOST { address: '${source}' })\n" +
"MERGE (user_id:USER { user_id: '${user_id}'})\nMERGE (source)-[:CONNECT]->(user_id)",
"Query will be executed on every log message.\n" +
"HTTP Mode: Use template substitutions to access message fields: ${took_ms}\n" +
"Bolt Mode: Use curly brackets only to access message fields: {took_ms}",
ConfigurationField.Optional.NOT_OPTIONAL, TextField.Attribute.TEXTAREA)
);
configurationRequest.addField(new TextField(
CK_NEO4J_USER, "API username", "neo4j",
"Username used for authorization",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_NEO4J_PASSWORD, "API password", "",
"Password used for authorization",
ConfigurationField.Optional.NOT_OPTIONAL, TextField.Attribute.IS_PASSWORD)
);
return configurationRequest;
}
开发者ID:mariussturm,项目名称:graylog-plugin-output-neo4j,代码行数:50,代码来源:Neo4jOutput.java
示例9: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.DropdownField; //导入依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest r = super.getRequestedConfiguration();
Map<String, String> regions = Maps.newHashMap();
for (Regions region : Regions.values()) {
regions.put(region.getName(), region.toString());
}
r.addField(new DropdownField(
CK_AWS_REGION,
"AWS Region",
Regions.US_EAST_1.getName(),
regions,
"The AWS region the Kinesis stream is running in.",
ConfigurationField.Optional.NOT_OPTIONAL
));
r.addField(new TextField(
CK_ACCESS_KEY,
"AWS access key",
"",
"Access key of an AWS user with sufficient permissions. (See documentation)",
ConfigurationField.Optional.OPTIONAL
));
r.addField(new TextField(
CK_SECRET_KEY,
"AWS secret key",
"",
"Secret key of an AWS user with sufficient permissions. (See documentation)",
ConfigurationField.Optional.OPTIONAL,
TextField.Attribute.IS_PASSWORD
));
r.addField(new TextField(
CK_ASSUME_ROLE_ARN,
"AWS assume role ARN",
"",
"Role ARN with required permissions (cross account access)",
ConfigurationField.Optional.OPTIONAL
));
r.addField(new TextField(
CK_KINESIS_STREAM_NAME,
"Kinesis Stream name",
"",
"The name of the Kinesis stream that receives your messages. See README for instructions on how to connect messages to a Kinesis Stream.",
ConfigurationField.Optional.NOT_OPTIONAL
));
return r;
}
开发者ID:Graylog2,项目名称:graylog-plugin-aws,代码行数:54,代码来源:KinesisTransport.java
示例10: getRequestedConfiguration
import org.graylog2.plugin.configuration.fields.DropdownField; //导入依赖的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 CloudTrail logs is in.",
ConfigurationField.Optional.NOT_OPTIONAL
));
r.addField(new TextField(
CK_SQS_NAME,
"SQS queue name",
"cloudtrail-notifications",
"The SQS queue that SNS is writing CloudTrail 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. (See documentation)",
ConfigurationField.Optional.OPTIONAL
));
r.addField(new TextField(
CK_SECRET_KEY,
"AWS secret key",
"",
"Secret key of an AWS user with sufficient permissions. (See documentation)",
ConfigurationField.Optional.OPTIONAL,
TextField.Attribute.IS_PASSWORD
));
r.addField(new TextField(
CK_ASSUME_ROLE_ARN,
"AWS assume role ARN",
"",
"The role ARN with required permissions (cross account access)",
ConfigurationField.Optional.OPTIONAL
));
return r;
}
开发者ID:Graylog2,项目名称:graylog-plugin-aws,代码行数:60,代码来源:CloudTrailTransport.java
注:本文中的org.graylog2.plugin.configuration.fields.DropdownField类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论