Beispiel #1
0
        public EventHerder(NetLogStash.Config.IConfiguration configuration)
        {
            _configuration = configuration;

            // check configuration validity
            if (!IsConfigurationValid(configuration))
            {
                throw new NetLogStash.Config.InvalidConfigurationException(configuration);
            }

            // initialize keystore
            KeyStore.Initialize(configuration.KeyStoreLocation);

            // create pipeline
            _pipeline = new Pipeline <Event>(
                configuration.Inputs.Select(i => i.Execute()),
                configuration.Filters.Select(f => new KeyValuePair <Func <Event, bool>, Func <Event, Event> >(f.Predicate, f.Execute)),
                configuration.Outputs.Select <IOutput, Action <Event> >(o => o.Execute)
                );
        }
Beispiel #2
0
 private bool IsConfigurationValid(NetLogStash.Config.IConfiguration configuration)
 {
     return(configuration != null && configuration.Inputs != null && configuration.Filters != null && configuration.Outputs != null && configuration.Inputs.Count > 0 && configuration.Outputs.Count > 0);
 }