2017-01-23 1 views
1

를 사용하여 - jsonpathNiFi | JSON 구문 분석 내가 Nifi 식 언어를 사용하여 내 JSON을 구문 분석하려고 Nifi 표현

https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#jsonpath

그것의 사용을 '.' 노드 트래버 설 (node ​​traversal). 노드 이름이 '.'인 json 그 안에.

다음은 내가 feedts을 읽을하려고하지만 부모 노드 'trigger_category.test_shashi는'거기에 ('.') 점을 가지고

{"feedName":"trigger_category.childfeed123", 
"feedId":"eff68e0b-a9e6-4c11-b74f-53f161a47faf", 
"dependentFeedNames":["trigger_category.test_shashi"], 
"feedJobExecutionContexts":{"trigger_category.test_shashi":[{"jobExecutionId":23946, 
"startTime":1485145059971, 
"endTime":1485145111733, 
"executionContext":{"feedts":"1485145061170"}}]}, 
"latestFeedJobExecutionContext":{"**trigger_category.test_shashi**":{"jobExecutionId":23946, 
"startTime":1485145059971, 
"endTime":1485145111733, 
"executionContext":{"**feedts**":"1485145061170"}}}} 

샘플 JSON에게 있습니다. 그 성격을 벗어나는 방법은 무엇입니까?

답변

2

here과 같이 대괄호를 사용하여 참조 할 수 있어야합니다.

그래서 JsonPath는 $.feedJobExecutionContexts.['trigger_category.test_shashi']이라고 생각합니다.