Examples of ConfigurationRequest


Examples of org.graylog2.plugin.configuration.ConfigurationRequest

*/
public abstract class ThrottleableTransport implements Transport {
    public static class Config implements Transport.Config {
        @Override
        public ConfigurationRequest getRequestedConfiguration() {
            return new ConfigurationRequest();
        }
View Full Code Here

Examples of org.graylog2.plugin.configuration.ConfigurationRequest

    }

    public static class Config implements Transport.Config {
        @Override
        public ConfigurationRequest getRequestedConfiguration() {
            return new ConfigurationRequest();
        }
View Full Code Here

Examples of org.graylog2.plugin.configuration.ConfigurationRequest

    }

    @Override
    public ConfigurationRequest getRequestedConfiguration() {
        // Built in output. This is just for plugin compat. No special configuration required.
        return new ConfigurationRequest();
    }
View Full Code Here

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

Examples of org.graylog2.plugin.configuration.ConfigurationRequest

    }

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

        final ConfigurationRequest request = gelfOutput.getRequestedConfiguration();

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

Examples of org.graylog2.plugin.configuration.ConfigurationRequest

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

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

Examples of org.graylog2.plugin.configuration.ConfigurationRequest

        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

Examples of org.graylog2.plugin.configuration.ConfigurationRequest

            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

Examples of org.graylog2.plugin.configuration.ConfigurationRequest

    @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

Examples of org.graylog2.plugin.configuration.ConfigurationRequest

    @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
TOP
Copyright © 2018 www.massapi.com. 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.