lordgamez commented on a change in pull request #976:
URL: https://github.com/apache/nifi-minifi-cpp/pull/976#discussion_r559525228



##########
File path: extensions/windows-event-log/ConsumeWindowsEventLog.cpp
##########
@@ -692,6 +734,42 @@ void 
ConsumeWindowsEventLog::putEventRenderFlowFileToSession(const EventRender&
     session.getProvenanceReporter()->receive(flowFile, provenanceUri_, 
getUUIDStr(), "Consume windows event logs", 0);
     session.transfer(flowFile, Success);
   }
+
+  if (output_.json.raw) {
+    auto flowFile = session.create();
+    logger_->log_trace("Writing rendered raw JSON to a flow file");
+
+    session.write(flowFile, &WriteCallback(eventRender.json.raw));
+    session.putAttribute(flowFile, core::SpecialFlowAttribute::MIME_TYPE, 
"application/json");
+    session.putAttribute(flowFile, "Timezone name", timezone_name_);
+    session.putAttribute(flowFile, "Timezone offset", timezone_offset_);
+    session.getProvenanceReporter()->receive(flowFile, provenanceUri_, 
getUUIDStr(), "Consume windows event logs", 0);
+    session.transfer(flowFile, Success);

Review comment:
       These lines seem to be the same for all json output formats. We could a 
single branch for all json output formats and only distinguish the 
`session.write` calls by json format type.

##########
File path: extensions/windows-event-log/ConsumeWindowsEventLog.h
##########
@@ -133,17 +141,29 @@ class ConsumeWindowsEventLog : public core::Processor {
   std::wstring wstrQuery_;
   std::string regex_;
   bool resolve_as_attributes_;

Review comment:
       I suppose this should be initialized as well.




----------------------------------------------------------------
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]


Reply via email to