Package org.graylog2.plugin.configuration

Examples of org.graylog2.plugin.configuration.ConfigurationRequest


    }

    @Override
    public ConfigurationRequest getRequestedConfiguration() {
        ConfigurationRequest configurationRequest = new ConfigurationRequest();
        configurationRequest.addField(new TextField("prefix", "Prefix", "Writing message: ", "How to prefix the message before logging it", ConfigurationField.Optional.OPTIONAL));
        return configurationRequest;
    }
View Full Code Here


    }

    public void testGetRequestedConfiguration() throws Exception {
        final GelfOutput gelfOutput = new GelfOutput();

        final ConfigurationRequest request = gelfOutput.getRequestedConfiguration();

        assertNotNull(request);
        assertNotNull(request.asList());
    }
View Full Code Here

        }
        metricRegistry.register(getUniqueReadableId(), localRegistry);
    }

    public void checkConfiguration() throws ConfigurationException {
        final ConfigurationRequest cr = getRequestedConfiguration();
        cr.check(getConfiguration());
    }
View Full Code Here

        this.contentPack = contentPack;
    }

    @SuppressWarnings("unchecked")
    public Object getAttributesWithMaskedPasswords() {
        final ConfigurationRequest config = getRequestedConfiguration();
        if (config == null) {
            return Collections.emptyMap();
        }

        final Map<String, Object> attributes = configuration.getSource();
        final Map<String, Object> result = Maps.newHashMapWithExpectedSize(attributes.size());
        for (Map.Entry<String, Object> attribute : attributes.entrySet()) {
            Object value = attribute.getValue();

            final Map<String, Map<String, Object>> configAsList = config.asList();
            final Map<String, Object> attributesForConfigSetting = configAsList.get(attribute.getKey());

            if (attributesForConfigSetting != null) {
                // we know the config setting, check its attributes
                final List<String> attrs = (List<String>) attributesForConfigSetting.get("attributes");
View Full Code Here

            this.transportConfig = transportConfig;
            this.codecConfig = codecConfig;
        }

        public ConfigurationRequest getRequestedConfiguration() {
            final ConfigurationRequest transport = transportConfig.getRequestedConfiguration();
            final ConfigurationRequest codec = codecConfig.getRequestedConfiguration();
            final ConfigurationRequest r = new ConfigurationRequest();
            r.putAll(transport.getFields());
            r.putAll(codec.getFields());

            r.addField(new TextField(
                    CK_OVERRIDE_SOURCE,
                    "Override source",
                    null,
                    "The source is a hostname derived from the received packet by default. Set this if you want to override " +
                            "it with a custom string.",
View Full Code Here

    @ConfigClass
    public static class Config extends ThrottleableTransport.Config {
        @Override
        public ConfigurationRequest getRequestedConfiguration() {
            final ConfigurationRequest cr = super.getRequestedConfiguration();

            cr.addField(new TextField(
                    CK_ZOOKEEPER,
                    "ZooKeeper address",
                    "192.168.1.1:2181",
                    "Host and port of the ZooKeeper that is managing your Kafka cluster.",
                    ConfigurationField.Optional.NOT_OPTIONAL));

            cr.addField(new TextField(
                    CK_TOPIC_FILTER,
                    "Topic filter regex",
                    "^your-topic$",
                    "Every topic that matches this regular expression will be consumed.",
                    ConfigurationField.Optional.NOT_OPTIONAL));

            cr.addField(new NumberField(
                    CK_FETCH_MIN_BYTES,
                    "Fetch minimum bytes",
                    5,
                    "Wait for a message batch to reach at least this size or the configured maximum wait time before fetching.",
                    ConfigurationField.Optional.NOT_OPTIONAL));

            cr.addField(new NumberField(
                    CK_FETCH_WAIT_MAX,
                    "Fetch maximum wait time (ms)",
                    100,
                    "Wait for this time or the configured minimum size of a message batch before fetching.",
                    ConfigurationField.Optional.NOT_OPTIONAL));

            cr.addField(new NumberField(
                    CK_THREADS,
                    "Processor threads",
                    2,
                    "Number of processor threads to spawn. Use one thread per Kafka topic partition.",
                    ConfigurationField.Optional.NOT_OPTIONAL));
View Full Code Here

    @ConfigClass
    public static class Config extends ThrottleableTransport.Config {
        @Override
        public ConfigurationRequest getRequestedConfiguration() {
            final ConfigurationRequest r = super.getRequestedConfiguration();

            r.addField(new TextField(
                    CK_SOURCE,
                    "Source",
                    "metrics",
                    "Define a name of the source. For example 'metrics'.",
                    ConfigurationField.Optional.NOT_OPTIONAL
            ));


            r.addField(
                    new NumberField(
                            CK_REPORT_INTERVAL,
                            "Report interval",
                            10,
                            "Time between each report. Select a time unit in the corresponding dropdown.",
                            ConfigurationField.Optional.NOT_OPTIONAL,
                            NumberField.Attribute.ONLY_POSITIVE
                    )
            );

            r.addField(
                    new DropdownField(
                            CK_REPORT_UNIT,
                            "Report interval unit",
                            TimeUnit.SECONDS.toString(),
                            DropdownField.ValueTemplates.timeUnits(),
                            ConfigurationField.Optional.NOT_OPTIONAL
                    )
            );

            r.addField(
                    new DropdownField(
                            CK_DURATION_UNIT,
                            "Time unit of measured durations",
                            TimeUnit.MILLISECONDS.toString(),
                            DropdownField.ValueTemplates.timeUnits(),
                            "The time unit that will be used in for example timer values. Think of: took 15ms",
                            ConfigurationField.Optional.NOT_OPTIONAL
                    )
            );

            r.addField(
                    new DropdownField(
                            CK_RATE_UNIT,
                            "Time unit of measured rates",
                            TimeUnit.SECONDS.toString(),
                            DropdownField.ValueTemplates.timeUnits(),
View Full Code Here

    @ConfigClass
    public static class Config extends ThrottleableTransport.Config {
        @Override
        public ConfigurationRequest getRequestedConfiguration() {
            final ConfigurationRequest r = super.getRequestedConfiguration();
            r.addField(new TextField(
                    CK_URL,
                    "URI of JSON resource",
                    "http://example.org/api",
                    "HTTP resource returning JSON on GET",
                    ConfigurationField.Optional.NOT_OPTIONAL
            ));

            r.addField(new TextField(
                    CK_HEADERS,
                    "Additional HTTP headers",
                    "",
                    "Add a comma separated list of additional HTTP headers. For example: Accept: application/json, X-Requester: Graylog2",
                    ConfigurationField.Optional.OPTIONAL
            ));

            r.addField(new NumberField(
                    CK_INTERVAL,
                    "Interval",
                    1,
                    "Time between every collector run. Select a time unit in the corresponding dropdown. Example: Run every 5 minutes.",
                    ConfigurationField.Optional.NOT_OPTIONAL
            ));

            r.addField(new DropdownField(
                    CK_TIMEUNIT,
                    "Interval time unit",
                    TimeUnit.MINUTES.toString(),
                    DropdownField.ValueTemplates.timeUnits(),
                    ConfigurationField.Optional.NOT_OPTIONAL
View Full Code Here

    @ConfigClass
    public static class Config extends GeneratorTransport.Config {
        @Override
        public ConfigurationRequest getRequestedConfiguration() {
            final ConfigurationRequest c = super.getRequestedConfiguration();
            c.addField(new NumberField(
                    CK_SLEEP,
                    "Sleep time",
                    25,
                    "How many milliseconds to sleep between generating messages.",
                    ConfigurationField.Optional.NOT_OPTIONAL,
                    NumberField.Attribute.ONLY_POSITIVE
            ));

            c.addField(new NumberField(
                    CK_SLEEP_DEVIATION_PERCENT,
                    "Maximum random sleep time deviation",
                    30,
                    "The deviation is used to generate a more realistic and non-steady message flow.",
                    ConfigurationField.Optional.NOT_OPTIONAL,
                    NumberField.Attribute.ONLY_POSITIVE
            ));

            c.addField(new TextField(
                    CK_SOURCE,
                    "Source name",
                    "example.org",
                    "What to use as source of the generate messages.",
                    ConfigurationField.Optional.NOT_OPTIONAL
View Full Code Here

    public static class Config extends AbstractTcpTransport.Config {
        public static final int DEFAULT_MAX_FRAME_LENGTH = 2 * 1024 * 1024;

        @Override
        public ConfigurationRequest getRequestedConfiguration() {
            final ConfigurationRequest x = super.getRequestedConfiguration();

            x.addField(
                    new BooleanField(
                            CK_USE_NULL_DELIMITER,
                            "Null frame delimiter?",
                            false,
                            "Use null byte as frame delimiter? Default is newline."
                    )
            );
            x.addField(
                    new NumberField(
                            CK_MAX_MESSAGE_SIZE,
                            "Maximum message size",
                            2 * 1024 * 1024,
                            "The maximum length of a message.",
View Full Code Here

TOP

Related Classes of org.graylog2.plugin.configuration.ConfigurationRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.