@InputRequirement(value=INPUT_REQUIRED) @TriggerWhenEmpty @Tags(value={"syslog","put","udp","tcp","logs"}) @CapabilityDescription(value="Sends Syslog messages to a given host and port over TCP or UDP. Messages are constructed from the \"Message ___\" properties of the processor which can use expression language to generate messages from incoming FlowFiles. The properties are used to construct messages of the form: (<PRIORITY>)(VERSION )(TIMESTAMP) (HOSTNAME) (BODY) where version is optional. The constructed messages are checked against regular expressions for RFC5424 and RFC3164 formatted messages. The timestamp can be an RFC5424 timestamp with a format of \"yyyy-MM-dd\'T\'HH:mm:ss.SZ\" or \"yyyy-MM-dd\'T\'HH:mm:ss.S+hh:mm\", or it can be an RFC3164 timestamp with a format of \"MMM d HH:mm:ss\". If a message is constructed that does not form a valid Syslog message according to the above description, then it is routed to the invalid relationship. Valid messages are sent to the Syslog server and successes are routed to the success relationship, failures routed to the failure relationship.") @SeeAlso(value={ListenSyslog.class,ParseSyslog.class}) public class PutSyslog extends AbstractSyslogProcessor
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
BATCH_SIZE |
private List<PropertyDescriptor> |
descriptors |
private EventSender<String> |
eventSender |
static PropertyDescriptor |
HOSTNAME |
static PropertyDescriptor |
IDLE_EXPIRATION |
static PropertyDescriptor |
MAX_SOCKET_SEND_BUFFER_SIZE |
static PropertyDescriptor |
MSG_BODY |
static PropertyDescriptor |
MSG_HOSTNAME |
static PropertyDescriptor |
MSG_PRIORITY |
static PropertyDescriptor |
MSG_TIMESTAMP |
static PropertyDescriptor |
MSG_VERSION |
static Relationship |
REL_FAILURE |
static Relationship |
REL_INVALID |
static Relationship |
REL_SUCCESS |
private Set<Relationship> |
relationships |
static PropertyDescriptor |
SSL_CONTEXT_SERVICE |
private String |
transitUri |
Constructor and Description |
---|
PutSyslog() |
Modifier and Type | Method and Description |
---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext context) |
protected EventSender<String> |
getEventSender(ProcessContext context) |
Set<Relationship> |
getRelationships() |
List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
private String |
getSyslogMessage(ProcessContext context,
FlowFile flowFile) |
protected void |
init(ProcessorInitializationContext context) |
private boolean |
isValid(String message) |
void |
onScheduled(ProcessContext context) |
void |
onStopped() |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public static final PropertyDescriptor HOSTNAME
public static final PropertyDescriptor MAX_SOCKET_SEND_BUFFER_SIZE
public static final PropertyDescriptor BATCH_SIZE
public static final PropertyDescriptor IDLE_EXPIRATION
public static final PropertyDescriptor MSG_PRIORITY
public static final PropertyDescriptor MSG_VERSION
public static final PropertyDescriptor MSG_TIMESTAMP
public static final PropertyDescriptor MSG_HOSTNAME
public static final PropertyDescriptor MSG_BODY
public static final PropertyDescriptor SSL_CONTEXT_SERVICE
public static final Relationship REL_SUCCESS
public static final Relationship REL_FAILURE
public static final Relationship REL_INVALID
private Set<Relationship> relationships
private List<PropertyDescriptor> descriptors
private EventSender<String> eventSender
private String transitUri
protected void init(ProcessorInitializationContext context)
init
in class AbstractSessionFactoryProcessor
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
public final List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
protected Collection<ValidationResult> customValidate(ValidationContext context)
customValidate
in class AbstractConfigurableComponent
@OnScheduled public void onScheduled(ProcessContext context) throws InterruptedException
InterruptedException
@OnStopped public void onStopped() throws Exception
Exception
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
protected EventSender<String> getEventSender(ProcessContext context)
private String getSyslogMessage(ProcessContext context, FlowFile flowFile)
private boolean isValid(String message)
Copyright © 2021 Apache NiFi Project. All rights reserved.