[
https://issues.apache.org/jira/browse/NIFI-2889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15568619#comment-15568619
]
Bryan Bende commented on NIFI-2889:
-----------------------------------
The sender is coming from calling InetAddress.toString() which says:
{code}
/**
* Converts this IP address to a {@code String}. The
* string returned is of the form: hostname / literal IP
* address.
*
* If the host name is unresolved, no reverse name service lookup
* is performed. The hostname part will be represented by an empty string.
*
* @return a string representation of this IP address.
*/
public String toString() {
String hostName = holder().getHostName();
return ((hostName != null) ? hostName : "")
+ "/" + getHostAddress();
}
{code}
We could still add syslog.ip, but you should be able to easily use an
UpdateAttribute processor and expression language to get the IP, something like:
{code}
syslog.ip = ${syslog.sender:substringAfter('/')}
{code}
> Add syslog.ip attribut to ListenSyslog processor
> ------------------------------------------------
>
> Key: NIFI-2889
> URL: https://issues.apache.org/jira/browse/NIFI-2889
> Project: Apache NiFi
> Issue Type: Wish
> Components: Core Framework
> Affects Versions: 1.0.0
> Reporter: Yohann
> Priority: Minor
>
> Currently, it's not possible to get the IP (v4/v6) address of the syslog
> server that sent the message.
> So, I would like a {{syslog.ip}} attribut with the IP address of the syslog
> server.
> Use case:
> - Useful for monitoring (with different policy monitoring depending of the IP)
> - The hostname is not always present in the syslog message, so the IP could
> be used to identify the syslog server that sent the message
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)