Created 05-01-2018 03:22 AM
I am ingesting data from Kafka and then splitting out a JSON field. I then want to check that said fields content is in a whitelist that is kept in HDFS. I am looking at ScanAttribute and it seems like the thing I need except it can't read from HDFS. I tried reading from HDFS and then copying the file to local disk but that had some problems. Is there a better way?
Chad
Created 05-01-2018 12:28 PM
Hi @Chad Shaw
How often your whitelist is updated? if not often, you can use NiFi to ingest it from HDFS, to store it in NiFi local server and use it with ScanAttribute.
Created 05-01-2018 12:28 PM
Hi @Chad Shaw
How often your whitelist is updated? if not often, you can use NiFi to ingest it from HDFS, to store it in NiFi local server and use it with ScanAttribute.
Created 05-01-2018 03:49 PM
Hi there,
I have broken out the import piece now so it doesn't run in line which is fine for now. The problem I have now is that ScanAttribute doesn't support expression language so I can't give it a variable to scan for... any suggestions?
Created 05-01-2018 03:52 PM
Can you give an example please? I can not see where the problem is
Created on 05-01-2018 04:24 PM - edited 08-18-2019 01:54 AM
Here is what I am doing currently. Essentially based on a field from the EvaluateJsonPath, lets call it ${someid}, I need to match that variable to a whitelist. That whitelist exists in HDFS but it could be loaded to local file or some cache if needed. If there is a match then I want to HTTPPost if not then I will drop the message. The issue is that ScanAttribute will only accept a regular expression and not a variable using expression language ${someid}.
I'm wondering if there is a better way. Maybe read in the whitelist to a CSV service and then lookup record... not sure how best to use a whitelist in Nifi.
Created on 05-01-2018 07:48 PM - edited 08-18-2019 01:54 AM
I ended up getting my whitelist to work. Here is what I did:
There might be a better way where I don't have to use RouteAttribute to compare two variables but this is working for me as of now.
Created 05-01-2018 08:21 PM
@Abdelkrim Hadjidj Your article was helpful as well:
https://community.hortonworks.com/articles/140231/data-flow-enrichment-with-nifi-part-2-lookupattrib...
Created 05-01-2018 08:38 PM
@Chad Shaw glad that you find the article useful 🙂