[
https://issues.apache.org/jira/browse/NIFI-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15984741#comment-15984741
]
ASF GitHub Bot commented on NIFI-2661:
--------------------------------------
Github user mattyb149 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1650#discussion_r113442378
--- Diff:
nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/main/java/org/apache/nifi/processors/GeoEnrichIP.java
---
@@ -76,26 +76,36 @@ public void onTrigger(final ProcessContext context,
final ProcessSession session
final DatabaseReader dbReader = databaseReaderRef.get();
final String ipAttributeName =
context.getProperty(IP_ADDRESS_ATTRIBUTE).evaluateAttributeExpressions(flowFile).getValue();
final String ipAttributeValue =
flowFile.getAttribute(ipAttributeName);
- if (StringUtils.isEmpty(ipAttributeName)) { //TODO need to add
additional validation - should look like an IPv4 or IPv6 addr for instance
+
+ if (StringUtils.isEmpty(ipAttributeName)) {
session.transfer(flowFile, REL_NOT_FOUND);
- getLogger().warn("Unable to find ip address for {}", new
Object[]{flowFile});
+ getLogger().warn("FlowFile '{}' aatribute '{}' was empty.
Routing to failure",
+ new Object[]{flowFile,
IP_ADDRESS_ATTRIBUTE.getDisplayName()});
return;
}
+
InetAddress inetAddress = null;
CityResponse response = null;
try {
inetAddress = InetAddress.getByName(ipAttributeValue);
} catch (final IOException ioe) {
session.transfer(flowFile, REL_NOT_FOUND);
- getLogger().warn("Could not resolve {} to ip address for {}",
new Object[]{ipAttributeValue, flowFile}, ioe);
+ getLogger().warn("Could not resolve the IP for value '{}',
contained within the attribute '{}' in " +
+ "FlowFile '{}'. This is usually caused by
issue resolving the appropriate DNS record or " +
+ "providing the processor with an invalid IP
address ",
+ new
Object[]{IP_ADDRESS_ATTRIBUTE.getDisplayName(), ipAttributeValue, flowFile},
ioe);
--- End diff --
The first two objects are reversed, I can fix this on merge
> Create enrichment processor supporting GeoLite ASN
> --------------------------------------------------
>
> Key: NIFI-2661
> URL: https://issues.apache.org/jira/browse/NIFI-2661
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Andre F de Miranda
> Assignee: Andre F de Miranda
>
> Current EnrichGeoIP does not support MaxMind's GeoLite ASN API and database.
> It would be great to have a processor capable of doing so.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)