Ejemplo n.º 1
0
        public override void ActivateOptions()
        {
            _client = new WebElasticClient(Server, Port, Ssl, AllowSelfSignedServerCert, BasicAuthUsername, BasicAuthPassword);

            if (Template != null && Template.IsValid)
            {
                _client.PutTemplateRaw(Template.Name, File.ReadAllText(Template.FileName));
            }

            ElasticFilters.PrepareConfiguration(_client);

            RestartTimer();
        }
        public override void ActivateOptions()
        {
            _client = new WebElasticClient(Server, Port);

            if (Template != null && Template.IsValid)
            {
                _client.PutTemplateRaw(Template.Name, File.ReadAllText(Template.FileName));
            }

            ElasticFilters.PrepareConfiguration(_client);

            RestartTimer();
        }
        public override void ActivateOptions()
        {
            AddOptionalServer();
            _client = new WebElasticClient(Servers, ElasticSearchTimeout, Ssl, AllowSelfSignedServerCert, AuthenticationMethod);

            LogEventFactory.Configure(this);

            if (Template != null && Template.IsValid)
            {
                _client.PutTemplateRaw(Template.Name, File.ReadAllText(Template.FileName));
            }

            ElasticFilters.PrepareConfiguration(_client);

            RestartTimer();
        }
Ejemplo n.º 4
0
        public override void ActivateOptions()
        {
            _client = new WebElasticClient(Server, Port, Ssl, AllowSelfSignedServerCert, BasicAuthUsername, BasicAuthPassword, UseAWS4Signer,
                                           AWS4SignerRegion, AWS4SignerAccessKey, AWS4SignerSecretKey, ElasticSearchTimeout);

            LogEventFactory.Configure(this);

            if (Template != null && Template.IsValid)
            {
                _client.PutTemplateRaw(Template.Name, File.ReadAllText(Template.FileName));
            }

            ElasticFilters.PrepareConfiguration(_client);

            RestartTimer();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Prepare the event and add it to the BulkDescriptor.
        /// </summary>
        /// <param name="logEvent"></param>
        private void PrepareAndAddToBulk(Dictionary <string, object> logEvent)
        {
            ElasticFilters.PrepareEvent(logEvent);

            var indexName = _indexName.Format(logEvent).ToLower();
            var indexType = _indexType.Format(logEvent);

            var operation = new InnerBulkOperation
            {
                Document  = logEvent,
                IndexName = indexName,
                IndexType = indexType
            };

            lock (_bulk)
            {
                _bulk.Add(operation);
            }
        }
Ejemplo n.º 6
0
        public override void ActivateOptions()
        {
            AddOptionalServer();
            _client = _elasticClientFactory.CreateClient(Servers, ElasticSearchTimeout, Ssl, AllowSelfSignedServerCert, AuthenticationMethod);

            _logEventConverter = _logEventConverterFactory.Create(FixedFields, SerializeObjects);

            if (Template != null && Template.IsValid)
            {
                if (IndexAsync)
                {
                    _client.PutTemplateRaw(Template.Name, _fileAccessor.ReadAllText(Template.FileName));
                }
                else
                {
                    _client.PutTemplateRaw(Template.Name, _fileAccessor.ReadAllText(Template.FileName));
                }
            }

            ElasticFilters.PrepareConfiguration(_client);

            _timer.Restart(BulkIdleTimeout);
        }