Search in sources :

Example 6 with MessageFilter

use of org.graylog2.plugin.filters.MessageFilter in project graylog2-server by Graylog2.

the class MessageFilterBindings method configure.

@Override
protected void configure() {
    Multibinder<MessageFilter> messageFilters = Multibinder.newSetBinder(binder(), MessageFilter.class);
    messageFilters.addBinding().to(StaticFieldFilter.class);
    messageFilters.addBinding().to(ExtractorFilter.class);
    messageFilters.addBinding().to(RulesFilter.class);
    messageFilters.addBinding().to(StreamMatcherFilter.class);
    // built it drools rules
    final Multibinder<URI> rulesUrls = Multibinder.newSetBinder(binder(), URI.class);
    try {
        final URI blacklistRulesUri = Resources.getResource("blacklist.drl").toURI();
        rulesUrls.addBinding().toInstance(blacklistRulesUri);
    } catch (URISyntaxException ignored) {
    // Ignore
    }
}
Also used : URISyntaxException(java.net.URISyntaxException) MessageFilter(org.graylog2.plugin.filters.MessageFilter) URI(java.net.URI)

Aggregations

MessageFilter (org.graylog2.plugin.filters.MessageFilter)6 MetricRegistry (com.codahale.metrics.MetricRegistry)4 Message (org.graylog2.plugin.Message)4 Test (org.junit.Test)4 Messages (org.graylog2.plugin.Messages)2 DateTime (org.joda.time.DateTime)2 Timer (com.codahale.metrics.Timer)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1