Member since
09-27-2018
138
Posts
23
Kudos Received
10
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
9755 | 02-28-2021 10:23 PM | |
1943 | 02-08-2021 11:53 PM | |
31785 | 12-16-2020 11:31 PM | |
7613 | 12-14-2020 11:02 PM | |
4847 | 12-14-2020 12:18 AM |
07-29-2019
10:51 AM
I'am struggling with Expression Language concerning nested and-/or-conditions. In my UpdateAttribute the variable KONTO_IST_AN should be getting the result in boolean which is provided by this expression. Sample content of RESPONSE (always exactly one element at one time): [{"antauschbis":"20191231","antauschvon":"20190101","id":"(422)"}] => expected result: true
[{"antauschbis":null,"antauschvon":"20190101","id":"(422)"}] => expected result: true
[{"antauschbis":"20190531","antauschvon":"20190101","id":"(422)"}] => expected result: false
[{"antauschbis":null,"antauschvon":"20200101","id":"(422)"}] => expected result: false Expression: ${RESPONSE:jsonPath('$.[0].id'):equals(${KONTO_BV}):
and(${RESPONSE:jsonPath('$.[0].antauschvon'):le(${now():format("yyyyMMdd")}):
and(${RESPONSE:jsonPath('$.[0].antauschbis'):ge(${now():format("yyyyMMdd")}):
or(
${RESPONSE:jsonPath('$.[0].antauschbis'):isEmpty()})}
)
)
} But there seems to by a syntax error because the attribute KONTO_IST_AN contains after execution of UpdateAttribute the above expression not the expected result. Checked all square and round brackets and can't finde my error. Could someone please tell me how to resolve this?
... View more
Labels:
- Labels:
-
Apache NiFi
07-24-2019
06:59 AM
Hi @Andrew Lim thank you for this detailed and step-by-step information, exactly what I was looking for. But I do have some questions which perhaps are a little weird caused by having no experience with github. 1. If I get this right the connection to github is "only" to store the content of each versioned flow outside the server where the registry is installed? So it is some kind of additional safty. Is this right? 2. Following your description one has to decide either using nifi-registry or github? Or did I get this wrong? 3. What if I try to connect to github and then want (only) to turn back to nifi-registry? Will this cause any predictable problems? 4. Is there any restriction in a clustered environment? I would be greatful if you will answer this questions, thanks a lot!
... View more
07-18-2019
05:55 AM
@Giulia Scalaberni Already with 1.9.0 So my theorie about context with update to 1.9.2 is invalid. Could you solve it with a NiFi-restart? Occured the problem during work with NiFi or after some inactivity too?
... View more
07-17-2019
07:42 AM
@Archon Gum I'm glad you answered! Yes, I'm using slack - since about 5 minutes... ;-)) Here's my email address which I will remove in about 2 hours: removed I'm looking forward to receive an appointment for our discussion because sometimes I'm not available, sorry!
... View more
07-16-2019
07:51 AM
Hi @Archon Gum , I know I'm very persistent but I see no other way than aksing you for help again. Ran the script from shell and received the message you added: python3.6 tmp_nifi_update_flow_ver.py --pg_id f5163735-016b-1000-0000-00002a32b939 --bucket_name Justen_Bucket --flow_name TEST_IJ_PG_1 --target_version latest
ERROR: bucket is None which means Justen_Bucket not exists Even when I use another bucket this message appears. It seems the nipyapi.versioning.get_registry_bucket(identifier=bucket_name, identifier_type='name') doesn't return the real buckets in registry. Is it possible to test this in another way? Could it be an authorization problem again? Sorry, but I see no way to solve this problem myself. It would be a pity if all your efforts were in vain... Thank you!
... View more
07-14-2019
04:12 PM
@Rosa Negra OK, processor EvaluateJsonPath extracted the content to attribute FF_CONTENT. To do the string manipulation within the attribute I suppose I have to use jsonPath function. But now I'm facing the same problem as before with RecordPath-syntax. I can't find the right syntax now to make the string manipulation within the attribute. I feel like going around in circles...
... View more
07-12-2019
10:15 AM
@Rosa Negra Thanks for this info. I will go into this as soon as I know that record-processing is suitable approach for this.
... View more
07-12-2019
10:07 AM
@Rosa Negra Tried with Jsonpath-expression, but UpdateRecord doesn't like it even though the expression is correct. I suppose it has to be RecordPath-expression here. UpdateRecord[id=5eb434f8-e995-123d-857f-704c2cff2c0c] Failed to process StandardFlowFileRecord[uuid=a7827a3b-566d-4470-832f-14c62dde7fc3,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1562840736703-7, container=default, section=7], offset=405512, length=283],offset=0,name=IJ_TEST,size=283];
will route to failure: Unexpected token ',' at line 1, column 22. Query: concat($..table..dnr, $..table..group)
Even if the Jsonpath-expression would have been accepted the problem remains still the same. Online validator result is also [ "(0)", "(0)" ] I suppose I have to point on the single entry and not to all entries of the array. Sorry can't explain it better...
... View more
07-12-2019
08:37 AM
1 Kudo
Hi all, I'm still working on a solution for this problem https://community.hortonworks.com/questions/248972/nifi-script-for-json-content-manipulation-before-j.html Following the recommendation of @Rosa Negra I try to do this with record-processing along this article of @Shu (thanks for this) https://community.hortonworks.com/content/kbentry/189642/update-the-contents-of-flowfile-by-using-updaterec.html Input-JSON {
"user": "Justen",
"stand": "20190702121621",
"table": [
{
"zn": 1,
"elem_user": "Meier",
"elem_stand": "20190705081410",
"dnr": "(0)",
"group": "1"
},
{
"elem_stand": "20190706201918",
"zn": 2,
"elem_user": "Schmidt",
"dnr": "(0)",
"group": "2"
}
]
} Desired Output-JSON {
"user": "Justen",
"stand": "2019-07-02 10:16:21",
"table": [
{
"zn": 1,
"elem_user": "Meier",
"elem_stand": "2019-07-05 06:14:10",
"dnr": "(0)",
"group": "1",
"dnr_group": "V-00-01"
},
{
"elem_stand": "2019-07-06 18:19:18",
"zn": 2,
"elem_user": "Schmidt",
"dnr": "(0)",
"group": "2",
"dnr_group": "V-00-02"
}
]
} actual Output-JSON of my flow [ {
"name" : "Justen",
"stand" : "2019-07-02 10:16:21.000",
"table" : [ {
"zn" : 1,
"elem_user" : "Meier",
"elem_stand" : "2019-07-05 06:14:10.000",
"dnr" : "(0)",
"group" : "1",
"dnr_group" : "(0)(0)12" ========> first expected "(0) 1"; ideal case "V-00-01"
}, {
"zn" : 2,
"elem_user" : "Schmidt",
"elem_stand" : "2019-07-06 18:19:18.000",
"dnr" : "(0)",
"group" : "2",
"dnr_group" : "(0)(0)12" ========> first expected "(0) 2"; ideal case "V-00-02"
} ]
} ] I had success with formatting the timestamps (stand, elem_stand)! But I can't find the rigt syntax for RecordPath setting "dnr_group". All examples here https://nifi.apache.org/docs.html in Apache NiFi RecordPath Guide don't show how to use functions working with elements of an array. In the second UpdateRecord (Change Value - Record Path) I tried "Property" /table[0..-1]/dnr_group for access on all elements which works, but at "Value" I don't know how to reference the elements dnr and group of the single entry. My aim is still to build this expression which works in EL... ${DNR:substringAfter('('):substringBefore(')'):toNumber()
:lt( 10 )
:ifElse(${DNR:substringAfter('('):substringBefore(')'):prepend('0')},
${DNR:substringAfter('('):substringBefore(')')})
:append('-'):append(${GROUP:toNumber()
:lt( 10 )
:ifElse(${GROUP:prepend('0')},
${GROUP})})
:prepend('V-')} Please have a look on the attachment which shows anything I defined in NiFi. Thanks for any help!
... View more
Labels:
- Labels:
-
Apache NiFi
07-10-2019
01:34 PM
@Walter Vos Thanks, saved me from loosing my mind!
... View more