Ejemplo n.º 1
0
        private bool ProcessEvents <T>(FilterDefinition <T> filter) where T : BaseHyperEvent, new()
        {
            var collection = MongoDatabase.GetCollection <T>(ParserConstants.HyperCollectionName);

            using (var persister = ExtractFactory.CreateExtract <T>())
                using (var processor = new SimpleModelProcessor <T, T>(persister, Log))
                {
                    processor.Process(collection, new QueryDefinition <T>(filter), item => item, filter);
                    return(persister.ItemsPersisted > 0);
                }
        }
Ejemplo n.º 2
0
        public override IPluginResponse Execute()
        {
            var pluginResponse = CreatePluginResponse();

            IMongoCollection <BsonDocument> collection = MongoDatabase.GetCollection <BsonDocument>(ParserConstants.TabAdminCollectionName);

            Log.Info("Processing Tableau Server version data from tabadmin logs...");
            var versions = TabadminVersionProcessor.BuildVersionTimeline(collection).ToList();

            bool persistedData;

            using (var persister = ExtractFactory.CreateExtract <TableauServerVersion>())
                using (GetPersisterStatusWriter(persister, versions.Count))
                {
                    persister.Enqueue(versions);
                    persistedData = persister.ItemsPersisted > 0;
                }

            using (var persister = ExtractFactory.CreateExtract <TabadminError>())
                using (var processor = new SimpleModelProcessor <BsonDocument, TabadminError>(persister, Log))
                {
                    var filter = BuildTabadminErrorFilter();
                    processor.Process(collection, new QueryDefinition <BsonDocument>(filter), document => new TabadminError(document, versions), filter);

                    persistedData = persistedData || persister.ItemsPersisted > 0;
                }

            using (var persister = ExtractFactory.CreateExtract <TabadminAction>())
                using (var processor = new SimpleModelProcessor <BsonDocument, TabadminAction>(persister, Log))
                {
                    var filter = BuildTabadminActionFilter();
                    processor.Process(collection, new QueryDefinition <BsonDocument>(filter), document => new TabadminAction(document, versions), filter);

                    persistedData = persistedData || persister.ItemsPersisted > 0;
                }

            if (!persistedData)
            {
                Log.Info("Failed to persist any data from Tabadmin logs!");
                pluginResponse.GeneratedNoData = true;
            }

            return(pluginResponse);
        }
Ejemplo n.º 3
0
        public override IPluginResponse Execute()
        {
            // The PluginResponse contains state about whether this plugin ran successfully, as well as any errors encountered.  Append any non-fatal errors to this.
            var pluginResponse = CreatePluginResponse();

            var collection = MongoDatabase.GetCollection <FlattenedArtEvent>(ParserConstants.VizqlServerCppCollectionName);
            var filter     = Builders <FlattenedArtEvent> .Filter.Where(line => line.ArtData != null);

            using (var persister = ExtractFactory.CreateExtract <FlattenedArtEvent>("Art.hyper"))
                using (var processor = new SimpleModelProcessor <FlattenedArtEvent, FlattenedArtEvent>(persister, Log))
                {
                    processor.Process(collection, new QueryDefinition <FlattenedArtEvent>(filter), item => item, filter);

                    if (persister.ItemsPersisted == 0)
                    {
                        Log.Info("Failed to persist any ART events!");
                        pluginResponse.GeneratedNoData = true;
                    }
                }

            return(pluginResponse);
        }
Ejemplo n.º 4
0
        public override IPluginResponse Execute()
        {
            var pluginResponse = CreatePluginResponse();

            IMongoCollection <HttpdRequest> collection = MongoDatabase.GetCollection <HttpdRequest>(ParserConstants.HttpdCollectionName);

            using (var persister = ExtractFactory.CreateExtract <HttpdRequest>("ApacheRequests.hyper"))
                using (var processor = new SimpleModelProcessor <HttpdRequest, HttpdRequest>(persister, Log))
                {
                    var apacheRequestFilter = BuildApacheRequestFilter(includeGatewayHealthCheckRequests);

                    processor.Process(collection, new QueryDefinition <HttpdRequest>(apacheRequestFilter), item => item, apacheRequestFilter);

                    if (persister.ItemsPersisted <= 0)
                    {
                        Log.Warn("Failed to persist any data from Apache logs!");
                        pluginResponse.GeneratedNoData = true;
                    }

                    return(pluginResponse);
                }
        }
Ejemplo n.º 5
0
        public override IPluginResponse Execute()
        {
            var pluginResponse = CreatePluginResponse();

            IMongoCollection <FilestoreEvent> collection = MongoDatabase.GetCollection <FilestoreEvent>(ParserConstants.FilestoreCollectionName);

            using (var persister = ExtractFactory.CreateExtract <FilestoreEvent>("FilestoreEvents.hyper"))
                using (var processor = new SimpleModelProcessor <FilestoreEvent, FilestoreEvent>(persister, Log))
                {
                    var filestoreEventFilter = Builders <FilestoreEvent> .Filter.Regex("file", new BsonRegularExpression("filestore.*"));

                    processor.Process(collection, new QueryDefinition <FilestoreEvent>(filestoreEventFilter), item => item, filestoreEventFilter);

                    if (persister.ItemsPersisted <= 0)
                    {
                        Log.Warn("Failed to persist any data from Filestore logs!");
                        pluginResponse.GeneratedNoData = true;
                    }

                    return(pluginResponse);
                }
        }