[
https://issues.apache.org/jira/browse/NIFI-5325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16518540#comment-16518540
]
ASF GitHub Bot commented on NIFI-5325:
--------------------------------------
Github user bbende commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2805#discussion_r196913302
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestParseSyslog5424.java
---
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+
+package org.apache.nifi.processors.standard;
+
+import com.github.palindromicity.syslog.NilPolicy;
+import org.apache.nifi.util.TestRunner;
+import org.apache.nifi.util.TestRunners;
+import org.junit.Test;
+
+public class TestParseSyslog5424 {
+ private static final String SYSLOG_LINE_ALL = "<14>1
2014-06-20T09:14:07+00:00 loggregator"
+ + " d0602076-b14a-4c55-852a-981e7afeed38 DEA MSG-01"
+ + " [exampleSDID@32473 iut=\"3\" eventSource=\"Application\"
eventID=\"1011\"]"
+ + " [exampleSDID@32480 iut=\"4\" eventSource=\"Other
Application\" eventID=\"2022\"] Removing instance";
+ private static final String SYSLOG_LINE_NILS= "<14>1
2014-06-20T09:14:07+00:00 -"
+ + " d0602076-b14a-4c55-852a-981e7afeed38 - -"
+ + " [exampleSDID@32473 iut=\"3\" eventSource=\"Application\"
eventID=\"1011\"]"
+ + " [exampleSDID@32480 iut=\"4\" eventSource=\"Other
Application\" eventID=\"2022\"] Removing instance";
+
+ @Test
+ public void testValidMessage() {
+ final TestRunner runner = TestRunners.newTestRunner(new
ParseSyslog5424());
+
runner.setProperty(ParseSyslog5424.NIL_POLICY,NilPolicy.DASH.name());
+ runner.enqueue(SYSLOG_LINE_ALL.getBytes());
+ runner.run();
+
runner.assertAllFlowFilesTransferred(ParseSyslog5424.REL_SUCCESS,1);
--- End diff --
Not totally necessary, but may want to verify that the flow file
transferred to success has some of the attributes you would expect from the
parsed message
> Need a Syslog Parser that fully supports the 5424 Spec
> ------------------------------------------------------
>
> Key: NIFI-5325
> URL: https://issues.apache.org/jira/browse/NIFI-5325
> Project: Apache NiFi
> Issue Type: New Feature
> Reporter: Otto Fowler
> Assignee: Otto Fowler
> Priority: Major
>
> from NIFI-5139
> "The Structured Data as described in
> [https://tools.ietf.org/html/rfc5424#section-6.3] are not read by Nifi.
>
> I suggest the SD to be put in attributes, prefixed by the ID:
> [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"]
> to become 3 attributes
> * exampleSID@32473-iut = 3
> * exampleSID@32473-eventSource=Application
> * exampleSID@32473-eventID=1011
>
> This could be useful to preprocess RFC5424 message, prioritize or route them."
>
> Nifi should a have a parser to fully support the spec and structured data.
> Since integrating it, and special casing the existing parser would
> simnifically complicate that processor and move it from it's least common
> denominator goal, it should be a new parser
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)