Igor, The "id" field you have is in your content, but PutElasticsearch is looking for a flow file attribute. This can be fixed by putting an EvaluateJsonPath processor before the PutElasticsearch processor, with the Destination property set to "flowfile-attribute" and add a dynamic property called "id" with a value of "$.id". This will extract the "id" field from your JSON content and put it in an "id" attribute. Then you can use "id" as the Identifier Attribute value in PutElasticsearch.
I admit this is one of the more confusing properties of the Elasticsearch processors and I sometimes doubt the "wisdom" behind my choice :-P Please let me know if this works for you, or if you have any other questions or issues. Regards, Matt On Tue, Jun 7, 2016 at 6:35 PM, Igor Kravzov <[email protected]> wrote: > Hi, > > I have JSON file something like this > > {"id":160889137,"url":"http://twitter.com/tchiagoolimpio/statuses/740301352253825024","pagetype":"twitter") > > and want ti use id as identifier in ES but getting the error bellow: > > 2016-06-07 18:16:40,363 ERROR [Timer-Driven Process Thread-3] > o.a.n.p.elasticsearch.PutElasticsearch > PutElasticsearch[id=e3430a8e-d24b-4d3f-bc41-90f2b64b45b8] No value in > identifier attribute id for > StandardFlowFileRecord[uuid=4a3432d4-2bbd-49e3-a01b-5d5bb9643577,claim=StandardContentClaim > [resourceClaim=StandardResourceClaim[id=1464868850132-2, container=default, > section=2], offset=311329, > length=317],offset=0,name=160889136.json,size=317], transferring to failure > > What can be wrong? > > It worked before for other JSON file but id was like this > > {"id":"160889137" > > Thanks in advance. >
