- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
update a get request to elastic search in nifi
- Labels:
-
Apache NiFi
Created on ‎08-09-2018 06:15 AM - edited ‎08-17-2019 07:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to hit a get request on my elastic search index using JSONelastisearchprocessor in NIFI. Now, for each flow file i have some incoming attributes, based on that i need to generate different get request and store the response somewhere.
The list of processors i'm using is as below:
- Getfile (to read JSON file)
- Evaluate JSON path (To extract the attributes which i want to use with every get request, PROC_INST_ID_ in this case )
- JSON queryelastic search (to hit the request with the below )
- PUTfile to store the response
Request body
{ "query": { "nested": { "path": "los", "query": { "bool": { "must": [ { "match": { "los.${proc_ins_id}":"784525" }}, { "match": { "los._source.cibilPermission.VALUE_":"1" }} ] } } } } }
I can't see the request being genrated and not getting any response instead i'm only getting the value of proc_ins_id as reponse in putfile. Can someone suggest some appropriate way to do this?
Attaching relevant screenshots as well for reference.
Created on ‎08-09-2018 01:31 PM - edited ‎08-17-2019 07:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please change EvaluateJsonPath processor configs Destination to flowfile-attribute
Now the processor will add the attribute to the flowfile then in JsonQueryElasticSearch processor will gets the attribute value and runs the query on ElasticSearch.
With Destination as flowfile-content will overwrites the existing flowfile content with PROC_INST_ID_ value.
JsonQueryElasticSearch Relationships:
Only feed the required relationships to PutFile processor i.e. hits (or) aggregations
Flow:
Created ‎08-09-2018 06:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you add something on it
Created on ‎08-09-2018 01:31 PM - edited ‎08-17-2019 07:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please change EvaluateJsonPath processor configs Destination to flowfile-attribute
Now the processor will add the attribute to the flowfile then in JsonQueryElasticSearch processor will gets the attribute value and runs the query on ElasticSearch.
With Destination as flowfile-content will overwrites the existing flowfile content with PROC_INST_ID_ value.
JsonQueryElasticSearch Relationships:
Only feed the required relationships to PutFile processor i.e. hits (or) aggregations
Flow:
Created ‎08-09-2018 01:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @Shu
