Member since
07-19-2018
4
Posts
0
Kudos Received
0
Solutions
07-26-2018
10:40 AM
Hello, I am trying
to do data validation in in XML in NiFi . Scenario is as below: Xml example:
<?xml version="1.0"
encoding="UTF-8" standalone="yes"?> <appLog id="7.8.0"
application="abc">
<nodeId>1234</ nodeId >
< branch id="22"> <logItem> <logId>111</logId> <subnodeId>1</areaId> <detail>sdadadadf</ detail
> <userId>005</userId> <trantime>19/07/2018
11:56:43</eventTime> <comments>abcdefgh</ comments
> </logItem>
</ branch > </applicationLog> Considering xml sample above I
need to check if attributes detail or comments are null and if so replace them
with ‘NA’ and put files in a separate folder for manual correction if user Id
is null. For the
validation part I tried EvaluateXPath with two xml files sample, one with error
and one without error but either both get matches or fail. I tried following
xquery and many more which run fine independently but do not give desired result in NiFi - EvaluateXquery: 1 )for $x in
/applicationLog/till/logItem where
($x/userId != '') return 'matched' 2 )if (exists(index-of(//userId, ''))) then
('unmatched') else ('matched') I plan to
use UpdateAttribute for replacing null value for detail and comments whoever did
not find any examples online to replace contents of xml file. Please help.
Thanks a lot in advance!
... View more
Labels:
07-26-2018
10:21 AM
Hello, Is there an option to provide password for a file extraction when using UnpackContent in Nifi. I am trying to extract zip files from a pack which requires a password for extraction. Thanks
... View more
Labels:
07-20-2018
09:15 AM
Thanks a lot Matt!! It helped. Also it turns out I was not running NiFi as administrator which was also a problem in renaming files in windows.
... View more
07-19-2018
07:23 AM
Hi, I am trying to use a very simple process GetFile SplitXML PutFile However, putfile throws error as all child files have same names and I get only one copy (first of the selected node depth data or last depending on my putFile conflict resolution strategy) I tried using updateAttribute process to change the file before sending to putFile but even that is not working. Please help. Any suggestions on why even a simple update filename operation is not working either. Could there be any issue with some settings? I am using nifi 1.7.0 Thanks
... View more
Labels: