本文整理汇总了Java中org.graylog2.plugin.configuration.ConfigurationRequest.addField方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationRequest.addField方法的具体用法?Java ConfigurationRequest.addField怎么用?Java ConfigurationRequest.addField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.graylog2.plugin.configuration.ConfigurationRequest
的用法示例。
在下文中一共展示了ConfigurationRequest.addField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRequestedConfiguration
import org.graylog2.plugin.configuration.ConfigurationRequest; //导入方法依赖的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.ConfigurationRequest; //导入方法依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest requestedConfiguration = super.getRequestedConfiguration();
requestedConfiguration.addField(new BooleanField(
CK_INCLUDE_SOURCE,
"Include source information",
true,
"Whether to include source information (package, class, line number)."));
requestedConfiguration.addField(new BooleanField(
CK_INCLUDE_THREAD_CONTEXT,
"Include thread context",
true,
"Whether to include the contents of the thread context."));
requestedConfiguration.addField(new BooleanField(
CK_INCLUDE_STACK_TRACE,
"Include stack traces",
true,
"Whether to include stack traces."));
requestedConfiguration.addField(new BooleanField(
CK_INCLUDE_EXCEPTION_CAUSE,
"Include exception causes",
true,
"Whether to include information about the exception cause."));
return requestedConfiguration;
}
示例3: getRequestedConfiguration
import org.graylog2.plugin.configuration.ConfigurationRequest; //导入方法依赖的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.ConfigurationRequest; //导入方法依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
ConfigurationRequest cr = new ConfigurationRequest();
cr.addField(new TextField(
CK_TIMEZONE,
"Timezone",
DateTimeZone.getDefault().getID(),
"Timezone of the timestamps in CEF messages. Set this to the local timezone if in doubt. Format example: \"+01:00\" or \"America/Chicago\"",
ConfigurationField.Optional.NOT_OPTIONAL
));
cr.addField(new TextField(
CK_LOCALE,
"Locale",
"",
"Locale to use for parsing the timestamps of CEF messages. Set this to english if in doubt. Format example: \"en\" or \"en_US\"",
ConfigurationField.Optional.OPTIONAL
));
cr.addField(new BooleanField(
CK_USE_FULL_NAMES,
"Use full field names",
false,
"Use full field names in CEF messages (as defined in the CEF specification)"
));
return cr;
}
示例5: getRequestedConfiguration
import org.graylog2.plugin.configuration.ConfigurationRequest; //导入方法依赖的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;
}
示例6: getRequestedConfiguration
import org.graylog2.plugin.configuration.ConfigurationRequest; //导入方法依赖的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.ConfigurationRequest; //导入方法依赖的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.ConfigurationRequest; //导入方法依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
configurationRequest.addField(new TextField("driver", "Driver to use", "", "Driver to initialize. Needed so URL can be handled properly.", ConfigurationField.Optional.OPTIONAL));
configurationRequest.addField(new TextField("url", "JDBC URL", "", "Fully qualified url proto://host/db to connect to.", ConfigurationField.Optional.NOT_OPTIONAL));
configurationRequest.addField(new TextField("username", "Username", "", "Username to connect as. Optional.", ConfigurationField.Optional.OPTIONAL));
configurationRequest.addField(new TextField("password", "Password", "", "Password for user. Optional.", ConfigurationField.Optional.OPTIONAL));
configurationRequest.addField(new TextField("fields", "Additional fields", "", "Comma separated list of additional fields for Message insert query", ConfigurationField.Optional.OPTIONAL));
configurationRequest.addField(new TextField("logInsertQuery", "Message insert query", DEFAULT_LOG_QUERY, "Query to execute to add log entry. Must contain required 4 columns and optional (see Additional fields). Must produce generated key (ID).", ConfigurationField.Optional.NOT_OPTIONAL));
configurationRequest.addField(new TextField("logInsertAttributeQuery", "Attribute insert query", DEFAULT_LOG_ATTR_QUERY, "Optional. If specified all attributes will be added.", ConfigurationField.Optional.OPTIONAL));
return configurationRequest;
}
示例9: getRequestedConfiguration
import org.graylog2.plugin.configuration.ConfigurationRequest; //导入方法依赖的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;
}
示例10: createSlackMessageOutputConfigurationRequest
import org.graylog2.plugin.configuration.ConfigurationRequest; //导入方法依赖的package包/类
public static ConfigurationRequest createSlackMessageOutputConfigurationRequest() {
final ConfigurationRequest configurationRequest = createSlackAlarmCallbackConfigurationRequest();
configurationRequest.addField(new BooleanField(
SlackConfiguration.CK_SHORT_MODE, "Short mode", false,
"Enable short mode? This strips down the Slack message to the bare minimum to take less space in the chat room. " +
"Not used in alarm callback but only in the message output module.")
);
return configurationRequest;
}
示例11: getRequestedConfiguration
import org.graylog2.plugin.configuration.ConfigurationRequest; //导入方法依赖的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;
}
示例12: getRequestedConfiguration
import org.graylog2.plugin.configuration.ConfigurationRequest; //导入方法依赖的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;
}
示例13: getRequestedConfiguration
import org.graylog2.plugin.configuration.ConfigurationRequest; //导入方法依赖的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
示例14: getRequestedConfiguration
import org.graylog2.plugin.configuration.ConfigurationRequest; //导入方法依赖的package包/类
@Override
public ConfigurationRequest getRequestedConfiguration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
configurationRequest.addField(new TextField("bashCommand", "Bash Command", "", "", ConfigurationField.Optional.NOT_OPTIONAL));
return configurationRequest;
}
示例15: configuration
import org.graylog2.plugin.configuration.ConfigurationRequest; //导入方法依赖的package包/类
public static ConfigurationRequest configuration() {
final ConfigurationRequest configurationRequest = new ConfigurationRequest();
configurationRequest.addField(new TextField(
CK_INSTANCE_URL, "JIRA Instance URL", "", "JIRA server URL.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_USERNAME, "Username", "", "Username to login to JIRA.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_PASSWORD, "Password", "", "Password to login to JIRA.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_PROJECT_KEY, "Project Key", "", "Project under which the issue will be created.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_ISSUE_TYPE, "Issue Type", "Bug", "Type of issue.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_GRAYLOG_URL, "Graylog URL", null,
"URL to your Graylog web interface. Used to build links in alarm notification.",
ConfigurationField.Optional.NOT_OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_PRIORITY, "Issue Priority", "P1", "Priority of the issue.",
ConfigurationField.Optional.OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_LABELS, "Labels", "graylog", "List of comma-separated labels to add to this issue.",
ConfigurationField.Optional.OPTIONAL)
);
configurationRequest.addField(new TextField(
CK_COMPONENTS, "Components", "", "List of comma-separated components to add to this issue.",
ConfigurationField.Optional.OPTIONAL)
);
return configurationRequest;
}