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.

EvaluateJSONPath: how to extract the field that have "." in the property name

Highlighted

EvaluateJSONPath: how to extract the field that have "." in the property name

I would like to extract the property "feedts" from the flowfile JSON using EvaluateJSONProcessor. JSON is as below

**********************JSON****************

{"latestFeedJobExecutionContext":{"demo.msexchange":{"jobExecutionId":87,"startTime":1501760142595,"endTime":1501760304816,"executionContext":{"feedts":"1501760190824"}}},"feedName":"test.test_trigger_data_transition","feedId":"474a06bc-7d47-4404-9935-7f7edea55979","dependentFeedNames":["demo.msexchange"]

*********************

I would like to know how can I overcome the character "." in the property name. In this case I have its "demo.msexchange".

Is there anyway I can extract the property "feedts" from above JSON.

3 REPLIES 3
Highlighted

Re: EvaluateJSONPath: how to extract the field that have "." in the property name

Have you tried $.latestFeedJobExecutionContext.demo\.msexchange.feedts ?

Re: EvaluateJSONPath: how to extract the field that have "." in the property name

Actually, according to this stackoverflow answer on a related issue, you want to do the following:
$.latestFeedJobExecutionContext.['demo.msexchange'].feedts

Highlighted

Re: EvaluateJSONPath: how to extract the field that have "." in the property name

@Dan Chaffelson

I tried that too. that does not help!

Don't have an account?
Coming from Hortonworks? Activate your account here