You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Sven Davison <sv...@gmail.com> on 2016/07/26 21:09:01 UTC

JsonSplit Question/Help

I’m trying to store each of the hash tags from a twitter post. They can be 0 or more and I’ve found the array via JSON but I’m not sure how to reference them other than via

$twitter.hashtags[0].text that’s not very dynamic… as I never know how many there will be.

Here’s a screenshot showing that they are extracted via EvaluateJsonPath… but I’m not sure how to split the array for use now.

http://prntscr.com/bxvse3


the plan is to do something with each tag, so they probably need to become their own flow file after being split up.. still learning!



Sent from Mail for Windows 10


RE: JsonSplit Question/Help

Posted by Sven Davison <sv...@gmail.com>.
WOOT! It took a minute but.. I got it! Thanks for the help!

http://prntscr.com/bxx5jc



Sent from Mail for Windows 10

From: Matt Burgess

RE: JsonSplit Question/Help

Posted by Sven Davison <sv...@gmail.com>.
Does it just become $twitter.hashtags without the index locators then? I’m not sure how to reference the content of the flowfile after it’s been split off. It LOOKS like it’s still the original full list vice element of the array.



Sent from Mail for Windows 10

From: Matt Burgess

Re: JsonSplit Question/Help

Posted by Matt Burgess <ma...@gmail.com>.
Sven,

You can use the SplitJson processor with a JSONPath value of
$.twitter.hashtags, it will create a new flowfile for each hashtag.
Then you can use EvaluateJsonPath to get the text value from each of
the flow files.

Regards,
Matt

On Tue, Jul 26, 2016 at 5:09 PM, Sven Davison <sv...@gmail.com> wrote:
> I’m trying to store each of the hash tags from a twitter post. They can be 0
> or more and I’ve found the array via JSON but I’m not sure how to reference
> them other than via
>
>
>
> $twitter.hashtags[0].text that’s not very dynamic… as I never know how many
> there will be.
>
>
>
> Here’s a screenshot showing that they are extracted via EvaluateJsonPath…
> but I’m not sure how to split the array for use now.
>
>
>
> http://prntscr.com/bxvse3
>
>
>
>
>
> the plan is to do something with each tag, so they probably need to become
> their own flow file after being split up.. still learning!
>
>
>
>
>
>
>
> Sent from Mail for Windows 10
>
>