You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Buntu Dev <bu...@gmail.com> on 2017/05/03 04:00:22 UTC

Convert output of ExtractMediaMetaData to JSON

I'm trying to convert the output of the ExtractMediaMetaData to JSON using
AttributesToJSON processor but the result seems to be still binary of the
JPEG image. How do I convert the output of ExtractMediaMetaData to JSON?

Also, there are some attributes such as "Blue Colorant", etc. How do I list
these attributes as comma-seperated list in the AttributesToJSON config?


Thanks!

Re: Convert output of ExtractMediaMetaData to JSON

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

Maybe you've already figure it out, but I think your AttributesToJSON
processor's 'Destination' property is set to 'flowfile-attribute' (by
default).
If so, created JSON is written in 'JSONAttributes' attribute. If you'd
like it to be as content of outgoing FlowFile, please use
'flowfile-content' instead.

For the 2nd question, you can concatenate attribute values with NiFi
Expression Language "join" function.
https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#join
UpdateAttribute processor can be used to add concatenated attribute
before AttributesToJSON.
But I don't know if there's any EL function to join attribute name and
value together. Join joins values only.

Hope this helps,
Koji

On Wed, May 3, 2017 at 1:00 PM, Buntu Dev <bu...@gmail.com> wrote:
> I'm trying to convert the output of the ExtractMediaMetaData to JSON using
> AttributesToJSON processor but the result seems to be still binary of the
> JPEG image. How do I convert the output of ExtractMediaMetaData to JSON?
>
> Also, there are some attributes such as "Blue Colorant", etc. How do I list
> these attributes as comma-seperated list in the AttributesToJSON config?
>
>
> Thanks!