phrocker commented on a change in pull request #551: MINIFICPP-773 Implemented. URL: https://github.com/apache/nifi-minifi-cpp/pull/551#discussion_r282309407
########## File path: extensions/windows-event-log/ConsumeWindowsEventLog.cpp ########## @@ -0,0 +1,322 @@ +/** + * @file ConsumeWindowsEventLog.cpp + * ConsumeWindowsEventLog class declaration + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ConsumeWindowsEventLog.h" +#include <vector> +#include <queue> +#include <map> +#include <set> +#include <sstream> +#include <stdio.h> +#include <string> +#include <iostream> +#include <memory> +#include <codecvt> + +#include "io/DataStream.h" +#include "core/ProcessContext.h" +#include "core/ProcessSession.h" + +#pragma comment(lib, "wevtapi.lib") + +namespace org { +namespace apache { +namespace nifi { +namespace minifi { +namespace processors { + +static const size_t MAX_RECORD_BUFFER_SIZE = 0x10000; // 64k +const std::string ConsumeWindowsEventLog::ProcessorName("ConsumeWindowsEventLog"); + +static const int DEFAULT_MAX_BUFFER = 1024 * 1024; + +core::Property ConsumeWindowsEventLog::Channel( + core::PropertyBuilder::createProperty("Channel")-> + isRequired(true)-> + withDefaultValue("System")-> + withDescription("The Windows Event Log Channel to listen to.")-> + supportsExpressionLanguage(true)-> + build()); + +core::Property ConsumeWindowsEventLog::Query( + core::PropertyBuilder::createProperty("Query")-> + isRequired(true)-> + withDefaultValue("*")-> + withDescription("XPath Query to filter events. (See https://msdn.microsoft.com/en-us/library/windows/desktop/dd996910(v=vs.85).aspx for examples.)")-> + supportsExpressionLanguage(true)-> + build()); + +core::Property ConsumeWindowsEventLog::MaxBufferSize( + core::PropertyBuilder::createProperty("Max Buffer Size")-> + isRequired(true)-> + withDefaultValue(std::to_string(1024 * 1024))-> Review comment: This is a size, so you may want to use `withDefaultValue<core::DataSizeValue>("1 MB")` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
