Evaluate json path with destination as flowfile-attribute returns null for a specified attribute

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Evaluate json path with destination as flowfile-attribute returns null for a specified attribute

Puspak
hi
The content of the flow file is as below .

{  
   "REQUEST":{  
      "SERVICENAME":"WTX_SERV_ECSESC",
      "WSTOKEN":"ZEegEneBot59",
      "ECSESC-INP":{  
         "SVCHEADER":{  
            "STATION":"OGG",
            "OFFICE":"001",
            "AGENT":"255"
         },
         "SVCACTION":"RETRIEVE",
         "PPP-INFO":{  
            "PPP":"68700200220",
            "KEYINFO":{  
               "DBKEY":"113313412401",
               "REVISION":"17"
            },
            "CRA-RATING":"Y"
         }
      }
   }
}

and i have set the value for pppNumber as
$."REQUEST"."ECSESC-INP"."AWB-INFO"."AWB" in the evaluate json path and set
the destination as flow-file-attribute , but i am getting the value for
pppNumber  as null



--
Sent from: http://apache-nifi-developer-list.39713.n7.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Evaluate json path with destination as flowfile-attribute returns null for a specified attribute

Denes Arvay
Hi Puspak,

As far as I know, you shouldn't use the quotes (") in the JSON path
expression. Plus, in your example JSON the AWB-INFO.AWB field is not
present.

Best,
Denes

On Mon, Jun 24, 2019 at 1:47 PM Puspak <[hidden email]> wrote:

> hi
> The content of the flow file is as below .
>
> {
>    "REQUEST":{
>       "SERVICENAME":"WTX_SERV_ECSESC",
>       "WSTOKEN":"ZEegEneBot59",
>       "ECSESC-INP":{
>          "SVCHEADER":{
>             "STATION":"OGG",
>             "OFFICE":"001",
>             "AGENT":"255"
>          },
>          "SVCACTION":"RETRIEVE",
>          "PPP-INFO":{
>             "PPP":"68700200220",
>             "KEYINFO":{
>                "DBKEY":"113313412401",
>                "REVISION":"17"
>             },
>             "CRA-RATING":"Y"
>          }
>       }
>    }
> }
>
> and i have set the value for pppNumber as
> $."REQUEST"."ECSESC-INP"."AWB-INFO"."AWB" in the evaluate json path and set
> the destination as flow-file-attribute , but i am getting the value for
> pppNumber  as null
>
>
>
> --
> Sent from: http://apache-nifi-developer-list.39713.n7.nabble.com/
>
Reply | Threaded
Open this post in threaded view
|

Re: Evaluate json path with destination as flowfile-attribute returns null for a specified attribute

Puspak
Thanks Dene for the quick response .

I have achieved the same by some other means.



--
Sent from: http://apache-nifi-developer-list.39713.n7.nabble.com/