0
votes

In NiFi, PutHDFS processor is used to ingest data into HDFS directory. There are 100+ variants of file types possible (all in json format). The json starts with file type. This file type should be made the file name prefix. How to achieve this? Please advise.

{
"FILE_TYPE_1": [
        {
                "ORG_FIELD_1" : 38,
                "ORG_FIELD_2" : 1,
                "ORG_FIELD_3" : "Per Km",
                "ORG_FIELD_4" : "x1",
                "ORG_FIELD_5" : 1,
                "ORG_FIELD_6" : 10.0,
                "ORG_FIELD_7" : 0.0,
                "ORG_FIELD_8" : 0.0,
                "ORG_FIELD_9" : 96.0,
                "ORG_FIELD_10" : 0
        }
    ]
}
1
Please show an example json so we can see where the file type comes from - Bryan Bende
Updated with example json. As per this json, the file name derived should be "FILE_TYPE_1_<timestamp>" - Vasanth Subramanian

1 Answers

1
votes

You can use EvaluateJsonPath to retrieve the name prefix to attribut then use UpdateAttribute to change the name