From b3911e56da1a3d376f2f08465cfb8969ab7d65e0 Mon Sep 17 00:00:00 2001 From: Joe Percivall Date: Wed, 14 Mar 2018 20:39:04 -0400 Subject: [PATCH 1/2] NIFI-4977 Adding expression language support to the Sender properties of PutSyslog --- .../standard/AbstractSyslogProcessor.java | 20 +++---- .../processors/standard/ListenSyslog.java | 57 ++++++++++++------- .../nifi/processors/standard/PutSyslog.java | 48 +++++++++++----- .../processors/standard/TestPutSyslog.java | 47 +++++++++++++++ 4 files changed, 124 insertions(+), 48 deletions(-) diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java index a8a6bef942c5..595059743a9c 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java @@ -29,34 +29,28 @@ public abstract class AbstractSyslogProcessor extends AbstractProcessor { public static final AllowableValue TCP_VALUE = new AllowableValue("TCP", "TCP"); public static final AllowableValue UDP_VALUE = new AllowableValue("UDP", "UDP"); - public static final PropertyDescriptor PROTOCOL = new PropertyDescriptor + public static final PropertyDescriptor PROTOCOL_PROP = new PropertyDescriptor .Builder().name("Protocol") .description("The protocol for Syslog communication.") .required(true) .allowableValues(TCP_VALUE, UDP_VALUE) .defaultValue(UDP_VALUE.getValue()) .build(); - public static final PropertyDescriptor PORT = new PropertyDescriptor + public static final PropertyDescriptor.Builder PORT_PROP_BUILDER = new PropertyDescriptor .Builder().name("Port") .description("The port for Syslog communication.") .required(true) - .addValidator(StandardValidators.PORT_VALIDATOR) - .build(); - public static final PropertyDescriptor CHARSET = new PropertyDescriptor.Builder() + .addValidator(StandardValidators.PORT_VALIDATOR); + public static final PropertyDescriptor.Builder CHARSET_PROP_BUILDER = new PropertyDescriptor.Builder() .name("Character Set") .description("Specifies the character set of the Syslog messages") .required(true) .defaultValue("UTF-8") - .addValidator(StandardValidators.CHARACTER_SET_VALIDATOR) - .build(); - public static final PropertyDescriptor TIMEOUT = new PropertyDescriptor.Builder() + .addValidator(StandardValidators.CHARACTER_SET_VALIDATOR); + public static final PropertyDescriptor.Builder TIMEOUT_PROP_BUILDER = new PropertyDescriptor.Builder() .name("Timeout") .description("The timeout for connecting to and communicating with the syslog server. Does not apply to UDP") .required(false) .defaultValue("10 seconds") - .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR) - .build(); - - - + .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR); } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java index d841e1588a91..604d58efb144 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java @@ -16,28 +16,6 @@ */ package org.apache.nifi.processors.standard; -import static org.apache.nifi.processor.util.listen.ListenerProperties.NETWORK_INTF_NAME; - -import java.io.IOException; -import java.io.OutputStream; -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.nio.ByteBuffer; -import java.nio.channels.SelectableChannel; -import java.nio.channels.SocketChannel; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; -import javax.net.ssl.SSLContext; import org.apache.commons.lang3.StringUtils; import org.apache.nifi.annotation.behavior.InputRequirement; import org.apache.nifi.annotation.behavior.SupportsBatching; @@ -77,6 +55,29 @@ import org.apache.nifi.ssl.RestrictedSSLContextService; import org.apache.nifi.ssl.SSLContextService; +import javax.net.ssl.SSLContext; +import java.io.IOException; +import java.io.OutputStream; +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.nio.ByteBuffer; +import java.nio.channels.SelectableChannel; +import java.nio.channels.SocketChannel; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; + +import static org.apache.nifi.processor.util.listen.ListenerProperties.NETWORK_INTF_NAME; + @SupportsBatching @InputRequirement(InputRequirement.Requirement.INPUT_FORBIDDEN) @Tags({"syslog", "listen", "udp", "tcp", "logs"}) @@ -114,6 +115,18 @@ public class ListenSyslog extends AbstractSyslogProcessor { .defaultValue("10000") .required(true) .build(); + + public static final PropertyDescriptor PORT = PORT_PROP_BUILDER + .build(); + + public static final PropertyDescriptor PROTOCOL = PROTOCOL_PROP; + + public static final PropertyDescriptor CHARSET = CHARSET_PROP_BUILDER + .build(); + + public static final PropertyDescriptor TIMEOUT = TIMEOUT_PROP_BUILDER + .build(); + public static final PropertyDescriptor RECV_BUFFER_SIZE = new PropertyDescriptor.Builder() .name("Receive Buffer Size") .displayName("Receive Buffer Size") diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java index 63f17ba244db..d9bc09c1b3fd 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java @@ -73,33 +73,55 @@ public class PutSyslog extends AbstractSyslogProcessor { public static final PropertyDescriptor HOSTNAME = new PropertyDescriptor.Builder() .name("Hostname") - .description("The ip address or hostname of the Syslog server.") + .description("The ip address or hostname of the Syslog server. Note that Expression language is not evaluated per FlowFile.") .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) .defaultValue("localhost") .required(true) + .expressionLanguageSupported(true) + .build(); + + public static final PropertyDescriptor PORT = PORT_PROP_BUILDER + .expressionLanguageSupported(true) + .description("The port for Syslog communication. Note that Expression language is not evaluated per FlowFile.") + .build(); + + public static final PropertyDescriptor PROTOCOL = PROTOCOL_PROP; + + public static final PropertyDescriptor CHARSET = CHARSET_PROP_BUILDER + .expressionLanguageSupported(true) + .description("Specifies the character set of the Syslog messages. Note that Expression language is not evaluated per FlowFile.") .build(); + + public static final PropertyDescriptor TIMEOUT = TIMEOUT_PROP_BUILDER + .expressionLanguageSupported(true) + .description("The timeout for connecting to and communicating with the syslog server. Does not apply to UDP. Note that Expression language is not evaluated per FlowFile.") + .build(); + public static final PropertyDescriptor MAX_SOCKET_SEND_BUFFER_SIZE = new PropertyDescriptor.Builder() .name("Max Size of Socket Send Buffer") .description("The maximum size of the socket send buffer that should be used. This is a suggestion to the Operating System " + "to indicate how big the socket buffer should be. If this value is set too low, the buffer may fill up before " + - "the data can be read, and incoming data will be dropped.") + "the data can be read, and incoming data will be dropped. Note that Expression language is not evaluated per FlowFile.") .addValidator(StandardValidators.DATA_SIZE_VALIDATOR) .defaultValue("1 MB") .required(true) + .expressionLanguageSupported(true) .build(); public static final PropertyDescriptor BATCH_SIZE = new PropertyDescriptor .Builder().name("Batch Size") - .description("The number of incoming FlowFiles to process in a single execution of this processor.") + .description("The number of incoming FlowFiles to process in a single execution of this processor. Note that Expression language is not evaluated per FlowFile.") .required(true) .defaultValue("25") .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR) + .expressionLanguageSupported(true) .build(); public static final PropertyDescriptor IDLE_EXPIRATION = new PropertyDescriptor .Builder().name("Idle Connection Expiration") - .description("The amount of time a connection should be held open without being used before closing the connection.") + .description("The amount of time a connection should be held open without being used before closing the connection. Note that Expression language is not evaluated per FlowFile.") .required(true) .defaultValue("5 seconds") .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR) + .expressionLanguageSupported(true) .build(); public static final PropertyDescriptor MSG_PRIORITY = new PropertyDescriptor .Builder().name("Message Priority") @@ -223,11 +245,11 @@ public void onScheduled(final ProcessContext context) throws IOException { } protected ChannelSender createSender(final ProcessContext context) throws IOException { - final int port = context.getProperty(PORT).asInteger(); - final String host = context.getProperty(HOSTNAME).getValue(); + final int port = context.getProperty(PORT).evaluateAttributeExpressions().asInteger(); + final String host = context.getProperty(HOSTNAME).evaluateAttributeExpressions().getValue(); final String protocol = context.getProperty(PROTOCOL).getValue(); - final int maxSendBuffer = context.getProperty(MAX_SOCKET_SEND_BUFFER_SIZE).asDataSize(DataUnit.B).intValue(); - final int timeout = context.getProperty(TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue(); + final int maxSendBuffer = context.getProperty(MAX_SOCKET_SEND_BUFFER_SIZE).evaluateAttributeExpressions().asDataSize(DataUnit.B).intValue(); + final int timeout = context.getProperty(TIMEOUT).evaluateAttributeExpressions().asTimePeriod(TimeUnit.MILLISECONDS).intValue(); final SSLContextService sslContextService = context.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class); return createSender(sslContextService, protocol, host, port, maxSendBuffer, timeout); } @@ -299,11 +321,11 @@ private PruneResult pruneIdleSenders(final long idleThreshold){ @Override public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { final String protocol = context.getProperty(PROTOCOL).getValue(); - final int batchSize = context.getProperty(BATCH_SIZE).asInteger(); + final int batchSize = context.getProperty(BATCH_SIZE).evaluateAttributeExpressions().asInteger(); final List flowFiles = session.get(batchSize); if (flowFiles == null || flowFiles.isEmpty()) { - final PruneResult result = pruneIdleSenders(context.getProperty(IDLE_EXPIRATION).asTimePeriod(TimeUnit.MILLISECONDS).longValue()); + final PruneResult result = pruneIdleSenders(context.getProperty(IDLE_EXPIRATION).evaluateAttributeExpressions().asTimePeriod(TimeUnit.MILLISECONDS).longValue()); // yield if we closed an idle connection, or if there were no connections in the first place if (result.getNumClosed() > 0 || (result.getNumClosed() == 0 && result.getNumConsidered() == 0)) { context.yield(); @@ -329,11 +351,11 @@ public void onTrigger(ProcessContext context, ProcessSession session) throws Pro } } - final String port = context.getProperty(PORT).getValue(); - final String host = context.getProperty(HOSTNAME).getValue(); + final String port = context.getProperty(PORT).evaluateAttributeExpressions().getValue(); + final String host = context.getProperty(HOSTNAME).evaluateAttributeExpressions().getValue(); final String transitUri = new StringBuilder().append(protocol).append("://").append(host).append(":").append(port).toString(); final AtomicReference exceptionHolder = new AtomicReference<>(null); - final Charset charSet = Charset.forName(context.getProperty(CHARSET).getValue()); + final Charset charSet = Charset.forName(context.getProperty(CHARSET).evaluateAttributeExpressions().getValue()); try { for (FlowFile flowFile : flowFiles) { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java index 60fe37dda86a..42569d97c9d4 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSyslog.java @@ -114,6 +114,53 @@ public void testValidMessageStaticPropertiesTcp() { Assert.assertEquals("TCP://localhost:12345", event.getTransitUri()); } + @Test + public void testValidELPropertiesTcp() { + final String pri = "34"; + final String version = "1"; + final String stamp = "2003-10-11T22:14:15.003Z"; + final String host = "mymachine.example.com"; + final String body = "su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8"; + + final String expectedMessage = "<" + pri + ">" + version + " " + stamp + " " + host + " " + body; + + runner.setProperty(PutSyslog.HOSTNAME, "${'hostname'}"); + runner.setProperty(PutSyslog.PORT, "${port}"); + runner.setProperty(PutSyslog.CHARSET, "${charset}"); + runner.setProperty(PutSyslog.TIMEOUT, "${timeout}"); + runner.setProperty(PutSyslog.MAX_SOCKET_SEND_BUFFER_SIZE, "${maxSocketSenderBufferSize}"); + runner.setProperty(PutSyslog.IDLE_EXPIRATION, "${idleExpiration}"); + runner.setProperty(PutSyslog.PROTOCOL, PutSyslog.TCP_VALUE); + runner.setProperty(PutSyslog.MSG_PRIORITY, pri); + runner.setProperty(PutSyslog.MSG_VERSION, version); + runner.setProperty(PutSyslog.MSG_TIMESTAMP, stamp); + runner.setProperty(PutSyslog.MSG_HOSTNAME, host); + runner.setProperty(PutSyslog.MSG_BODY, body); + + runner.assertValid(); + runner.setVariable("hostname", "hostname"); + runner.setVariable("port", "10443"); + runner.setVariable("charset", "UTF-8"); + runner.setVariable("timeout", "10 secs"); + runner.setVariable("maxSocketSenderBufferSize", "10 mb"); + runner.setVariable("idleExpiration", "10 secs"); + + runner.enqueue("incoming data".getBytes(Charset.forName("UTF-8"))); + runner.run(); + + runner.assertAllFlowFilesTransferred(PutSyslog.REL_SUCCESS, 1); + Assert.assertEquals(1, sender.messages.size()); + Assert.assertEquals(expectedMessage, sender.messages.get(0).replace("\n", "")); + + final List events = runner.getProvenanceEvents(); + Assert.assertNotNull(events); + Assert.assertEquals(1, events.size()); + + final ProvenanceEventRecord event = events.get(0); + Assert.assertEquals(ProvenanceEventType.SEND, event.getEventType()); + Assert.assertEquals("TCP://hostname:10443", event.getTransitUri()); + } + @Test public void testValidMessageStaticPropertiesNoVersion() { final String pri = "34"; From 9f780f5a948e91aed4f3a7f88af47649baffe5b2 Mon Sep 17 00:00:00 2001 From: Joe Percivall Date: Mon, 26 Mar 2018 13:57:22 -0400 Subject: [PATCH 2/2] Updating in response to PR feedback --- .../standard/AbstractSyslogProcessor.java | 29 ++++++++++++------- .../processors/standard/ListenSyslog.java | 17 ++--------- .../nifi/processors/standard/PutSyslog.java | 17 ----------- .../processors/standard/TestListenSyslog.java | 2 +- 4 files changed, 23 insertions(+), 42 deletions(-) diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java index 595059743a9c..f7319f2edbe7 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractSyslogProcessor.java @@ -29,28 +29,37 @@ public abstract class AbstractSyslogProcessor extends AbstractProcessor { public static final AllowableValue TCP_VALUE = new AllowableValue("TCP", "TCP"); public static final AllowableValue UDP_VALUE = new AllowableValue("UDP", "UDP"); - public static final PropertyDescriptor PROTOCOL_PROP = new PropertyDescriptor + public static final PropertyDescriptor PROTOCOL = new PropertyDescriptor .Builder().name("Protocol") .description("The protocol for Syslog communication.") .required(true) .allowableValues(TCP_VALUE, UDP_VALUE) .defaultValue(UDP_VALUE.getValue()) .build(); - public static final PropertyDescriptor.Builder PORT_PROP_BUILDER = new PropertyDescriptor + public static final PropertyDescriptor PORT = new PropertyDescriptor .Builder().name("Port") - .description("The port for Syslog communication.") + .description("The port for Syslog communication. Note that Expression language is not evaluated per FlowFile.") .required(true) - .addValidator(StandardValidators.PORT_VALIDATOR); - public static final PropertyDescriptor.Builder CHARSET_PROP_BUILDER = new PropertyDescriptor.Builder() + .addValidator(StandardValidators.PORT_VALIDATOR) + .expressionLanguageSupported(true) + .build(); + public static final PropertyDescriptor CHARSET = new PropertyDescriptor.Builder() .name("Character Set") - .description("Specifies the character set of the Syslog messages") + .description("Specifies the character set of the Syslog messages. Note that Expression language is not evaluated per FlowFile.") .required(true) .defaultValue("UTF-8") - .addValidator(StandardValidators.CHARACTER_SET_VALIDATOR); - public static final PropertyDescriptor.Builder TIMEOUT_PROP_BUILDER = new PropertyDescriptor.Builder() + .addValidator(StandardValidators.CHARACTER_SET_VALIDATOR) + .expressionLanguageSupported(true) + .build(); + public static final PropertyDescriptor TIMEOUT = new PropertyDescriptor.Builder() .name("Timeout") - .description("The timeout for connecting to and communicating with the syslog server. Does not apply to UDP") + .description("The timeout for connecting to and communicating with the syslog server. Does not apply to UDP. Note that Expression language is not evaluated per FlowFile.") .required(false) .defaultValue("10 seconds") - .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR); + .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR) + .expressionLanguageSupported(true) + .build(); + + + } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java index 604d58efb144..fb239eee1e35 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java @@ -116,17 +116,6 @@ public class ListenSyslog extends AbstractSyslogProcessor { .required(true) .build(); - public static final PropertyDescriptor PORT = PORT_PROP_BUILDER - .build(); - - public static final PropertyDescriptor PROTOCOL = PROTOCOL_PROP; - - public static final PropertyDescriptor CHARSET = CHARSET_PROP_BUILDER - .build(); - - public static final PropertyDescriptor TIMEOUT = TIMEOUT_PROP_BUILDER - .build(); - public static final PropertyDescriptor RECV_BUFFER_SIZE = new PropertyDescriptor.Builder() .name("Receive Buffer Size") .displayName("Receive Buffer Size") @@ -298,13 +287,13 @@ protected Collection customValidate(final ValidationContext va @OnScheduled public void onScheduled(final ProcessContext context) throws IOException { - final int port = context.getProperty(PORT).asInteger(); + final int port = context.getProperty(PORT).evaluateAttributeExpressions().asInteger(); final int bufferSize = context.getProperty(RECV_BUFFER_SIZE).asDataSize(DataUnit.B).intValue(); final int maxChannelBufferSize = context.getProperty(MAX_SOCKET_BUFFER_SIZE).asDataSize(DataUnit.B).intValue(); final int maxMessageQueueSize = context.getProperty(MAX_MESSAGE_QUEUE_SIZE).asInteger(); final String protocol = context.getProperty(PROTOCOL).getValue(); final String nicIPAddressStr = context.getProperty(NETWORK_INTF_NAME).evaluateAttributeExpressions().getValue(); - final String charSet = context.getProperty(CHARSET).getValue(); + final String charSet = context.getProperty(CHARSET).evaluateAttributeExpressions().getValue(); final String msgDemarcator = context.getProperty(MESSAGE_DELIMITER).getValue().replace("\\n", "\n").replace("\\r", "\r").replace("\\t", "\t"); messageDemarcatorBytes = msgDemarcator.getBytes(Charset.forName(charSet)); @@ -426,7 +415,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session final int maxBatchSize = context.getProperty(MAX_BATCH_SIZE).asInteger(); - final String port = context.getProperty(PORT).getValue(); + final String port = context.getProperty(PORT).evaluateAttributeExpressions().getValue(); final String protocol = context.getProperty(PROTOCOL).getValue(); final Map defaultAttributes = new HashMap<>(4); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java index d9bc09c1b3fd..81b016fdc1d1 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java @@ -80,23 +80,6 @@ public class PutSyslog extends AbstractSyslogProcessor { .expressionLanguageSupported(true) .build(); - public static final PropertyDescriptor PORT = PORT_PROP_BUILDER - .expressionLanguageSupported(true) - .description("The port for Syslog communication. Note that Expression language is not evaluated per FlowFile.") - .build(); - - public static final PropertyDescriptor PROTOCOL = PROTOCOL_PROP; - - public static final PropertyDescriptor CHARSET = CHARSET_PROP_BUILDER - .expressionLanguageSupported(true) - .description("Specifies the character set of the Syslog messages. Note that Expression language is not evaluated per FlowFile.") - .build(); - - public static final PropertyDescriptor TIMEOUT = TIMEOUT_PROP_BUILDER - .expressionLanguageSupported(true) - .description("The timeout for connecting to and communicating with the syslog server. Does not apply to UDP. Note that Expression language is not evaluated per FlowFile.") - .build(); - public static final PropertyDescriptor MAX_SOCKET_SEND_BUFFER_SIZE = new PropertyDescriptor.Builder() .name("Max Size of Socket Send Buffer") .description("The maximum size of the socket send buffer that should be used. This is a suggestion to the Operating System " + diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java index 2c199c1b4c4a..66c3a83ea8e0 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java @@ -253,7 +253,7 @@ public CannedMessageProcessor(final List events) { public List getSupportedPropertyDescriptors() { final List properties = new ArrayList<>(super.getSupportedPropertyDescriptors()); properties.remove(PORT); - properties.add(new PropertyDescriptor.Builder().name(PORT.getName()).addValidator(Validator.VALID).build()); + properties.add(new PropertyDescriptor.Builder().name(PORT.getName()).expressionLanguageSupported(true).addValidator(Validator.VALID).build()); return properties; }