Could you use UpdateAttribute to rename attributes before getting to
AttributesToJson?
For example, if you had my.attribute then in UpdateAttribute make it
my_attribute = ${my.attribute}
An alternative solution for the future might be the TransformJson processor
that is coming, which I believe can rename fields in the JSON:
https://issues.apache.org/jira/browse/NIFI-361
On Wed, May 4, 2016 at 7:49 PM, Ronnie Dove <[email protected]> wrote:
> Is there anyway to change all attribute names to exclude the period (.)?
> For example, we have recently ran into an issue where ElasticSearch stopped
> allowing users to put period/dot's (
> https://discuss.elastic.co/t/field-name-cannot-contain/33251) in field
> names (we were automatically using AttributesToJson to do this). I came up
> with a workaround by modifying the output of AttributesToJson with
> ReplaceText but....I wish there was an easier way.
>
> Additionally PutMongoDB's processor is trying to insert dotted field names
> and bson's library does not allow that either.
>
> Is there any advice or a solution available that would quickly convert my
> attributes to have an underscore instead of dot. Or would it require
> changing of these processors to support a custom attribute field name
> replacement. Or is there a config for the delimiter to use in field names
> of the attributes.
>
> --
> Ronnie Dove
> Senior Game Engine Developer
> http://www.techtunk.com
>