OK. I found what was wrong. In EvaluateJsonPath processor I had to set Destination property to flowfile-attribute. It works. Thanks Matt for the response.
On Tue, Jun 7, 2016 at 7:35 PM, Matt Burgess <[email protected]> wrote: > Yes that's strange that it would be required to be a string; when it's > converted to an attribute by EvaluateJsonPath it should be converted to a > String. If this is indeed the distinction please let us know, it sounds > like it could be a bug. > > Regards, > Matt > > On Jun 7, 2016, at 7:30 PM, Igor Kravzov <[email protected]> wrote: > > Matt, > > I actually had EvaluateJsonPath before ES processor with id as attribute > and $.id as value but had the same issue. Will try again. maybe had > a mistake somwhere. > > I wonder if {"id":160889137 instead of {"id":"160889137" causes the issue. > > > On Tue, Jun 7, 2016 at 6:53 PM, Matt Burgess <[email protected]> wrote: > >> 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. >> > >> > >
