You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Igor Kravzov <ig...@gmail.com> on 2016/08/08 18:47:21 UTC

EvaluateJsonPath processor question

Hi,

In my workflow I need to identify retweets. According to Twitter API

"Native retweets" are tweet objects that contain a child "retweeted_status"
node that contains the original tweet being retweeted. Identify them by the
presence or absence of that node.

I am using EvaluateJsonPath processor to extract some tweet data and also
want to check if "retweeted_status" node exists. What the best way to do it?

Thinking to extract  $.retweeted_status.id_str  into an attribute and to
check if it is empty or not. But not sure how the processor will behave in
absence of retweeted_status node.

Thanks in advance.

Re: EvaluateJsonPath processor question

Posted by Igor Kravzov <ig...@gmail.com>.
It worked. Thank you.

On Mon, Aug 8, 2016 at 3:01 PM, Aldrin Piri <al...@gmail.com> wrote:

> Igor,
>
> Seems perfectly reasonable.  If the path is not found, an empty value will
> result.  You can control in the processor properties as to whether or not
> this is a warn worthy event or if it should be ignored; the configuration
> you would likely desire in this case.
>
> Let us know if this does not work out as anticipated.
>
>
>
>
> On Mon, Aug 8, 2016 at 2:47 PM, Igor Kravzov <ig...@gmail.com>
> wrote:
>
>> Hi,
>>
>> In my workflow I need to identify retweets. According to Twitter API
>>
>> "Native retweets" are tweet objects that contain a child
>> "retweeted_status" node that contains the original tweet being retweeted.
>> Identify them by the presence or absence of that node.
>>
>> I am using EvaluateJsonPath processor to extract some tweet data and also
>> want to check if "retweeted_status" node exists. What the best way to do it?
>>
>> Thinking to extract  $.retweeted_status.id_str  into an attribute and to
>> check if it is empty or not. But not sure how the processor will behave in
>> absence of retweeted_status node.
>>
>> Thanks in advance.
>>
>
>

Re: EvaluateJsonPath processor question

Posted by Aldrin Piri <al...@gmail.com>.
Igor,

Seems perfectly reasonable.  If the path is not found, an empty value will
result.  You can control in the processor properties as to whether or not
this is a warn worthy event or if it should be ignored; the configuration
you would likely desire in this case.

Let us know if this does not work out as anticipated.




On Mon, Aug 8, 2016 at 2:47 PM, Igor Kravzov <ig...@gmail.com> wrote:

> Hi,
>
> In my workflow I need to identify retweets. According to Twitter API
>
> "Native retweets" are tweet objects that contain a child
> "retweeted_status" node that contains the original tweet being retweeted.
> Identify them by the presence or absence of that node.
>
> I am using EvaluateJsonPath processor to extract some tweet data and also
> want to check if "retweeted_status" node exists. What the best way to do it?
>
> Thinking to extract  $.retweeted_status.id_str  into an attribute and to
> check if it is empty or not. But not sure how the processor will behave in
> absence of retweeted_status node.
>
> Thanks in advance.
>