You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by plj <pl...@mitre.org> on 2017/07/12 18:05:31 UTC

Adding properties

Howdy,

  I've been away from NiFi for awhile and have forgotten how to do some
things.  I'm using the GetMongo processor (1.2) and I want to use the 'Mongo
Collection Name' property later .  How do I do that?
  I've tried adding a property to the GetMongo processor but it always
complaints that it isn't legal.  I added the property myproperty and set the
value to collectionname.  I get the error:

"'myproperty' validated against 'collectionname' is invalid because
'myproperty' is not a supported property"

Eventually I would like to save the results from the GetMongo to a file.  I
would like the filename to be the collectionname_date_time.  How should I be
doing this.

Thank for your help



--
View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/Adding-properties-tp16413.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Re: Adding properties

Posted by Koji Kawamura <ij...@gmail.com>.
Hi,

By looking at GetMongo source code and its docs, I believe it doesn't
write specified 'Mongo Collection Name' to any attribute of outgoing
FlowFiles. So you wouldn't be able to refer it from other processors
at downstream of your flow.
Please file a JIRA if this is needed.
https://issues.apache.org/jira/projects/NIFI

Usually, UpdateAttribute is used to set a 'filename' FlowFile
attribute using NiFi Attribute Expression Language, e.g. Add
'filename' dynamic property to UpdateAttribute with setting such as
"${collectionname}_${now():format('yyyyMMdd_HHmmss')}". But
collectionname is not available as I mentioned before.

The reason you get "myproperty is invalid" error is because GetMongo
doesn't support any dynamic properties.

Hope this helps.

Thanks,
Koji

On Thu, Jul 13, 2017 at 3:05 AM, plj <pl...@mitre.org> wrote:
> Howdy,
>
>   I've been away from NiFi for awhile and have forgotten how to do some
> things.  I'm using the GetMongo processor (1.2) and I want to use the 'Mongo
> Collection Name' property later .  How do I do that?
>   I've tried adding a property to the GetMongo processor but it always
> complaints that it isn't legal.  I added the property myproperty and set the
> value to collectionname.  I get the error:
>
> "'myproperty' validated against 'collectionname' is invalid because
> 'myproperty' is not a supported property"
>
> Eventually I would like to save the results from the GetMongo to a file.  I
> would like the filename to be the collectionname_date_time.  How should I be
> doing this.
>
> Thank for your help
>
>
>
> --
> View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/Adding-properties-tp16413.html
> Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.