Skip to main content
Olivia_4692
Gold ⭐️
March 12, 2022
Solved

LookupRecord Processor always routes to unmatched even if matched

I have the following json file :

“a”:{

    “after”:{

        “a123”:{

                 “ip”:”1.0.0.0”,

                 “p_id”:”4500”

                   }

           },

“before”:{

        “a123”:{

            “ip”:”1.0.0.0”,

            “p_id”:”4500

                  }

            }

}

 

I'm trying to create a lookuprecord Processor in NiFi to match with the p_id. If matched then route to something and if unmatched then route to something else. The lookuprecord processor I have is a MongoDBLookUpService.

The user expression I've written for the lookuprecord processor is :

key : /a/after/*['p_id']

Note: [*] because that bit in json keeps changing with every json file.

I've even tried /a/after/*/p_id and nothing seems to work.

 

They all seem to route to unmatched. Please help me figure out if I'm doing something wrong in the expression.

Olivia_4692
Gold ⭐️
March 17, 2022

Update : I solved this. I had to use a splitjson before the lookup record processor, then it worked all fine.

2 replies

Olivia_4692
Olivia_4692AuthorAnswer
Gold ⭐️
March 17, 2022

Update : I solved this. I had to use a splitjson before the lookup record processor, then it worked all fine.

Translate
cjervis
Community Manager
Community Manager
March 17, 2022

@Olivia_4692  I'm happy to see you resolved your issue. Please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. 

Screen Shot 2019-08-06 at 1.54.47 PM.pngmark as solution button

Translate
Keep the questions coming