Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Update an attribute within another attribute in Apache Nifi

Highlighted

Update an attribute within another attribute in Apache Nifi

New Contributor

I have a workflow which loads JSON templates from SQL which contain attribute placeholders:

{
    "agent": "${hostname(true)}",
    "startDate": "${startDate}",
    "endDate": "${endDate}",
    "data": "${data}"
}

These templates contain placeholder attributes which I'd like to replace with the value of real attributes in the Flowfile e.g. ${endDate}

109884-1563373661265.png

The SQL results are converted to JSON using ConvertAvroToJSON and then converted to an attribute named: analysisMethodArgs using EvaluateJsonPath.

I've tried ReplaceText to replace the Flowfile content with the analysisMethodArgs attribute, but it still results in the placeholders in the text and not the actual attribute values.

Is this possible?