Support Questions

Find answers, ask questions, and share your expertise

Does NiFi have a processor to expand a tar or zip file?

avatar
Master Guru

Does NiFi have a processor to expand a tar or zip file and allow access/process to files within?

1 ACCEPTED SOLUTION

avatar
Expert Contributor

Hey Sunile,

I believe you are looking for the unpack content processor found here

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.UnpackContent/...

Allowable file types:

  • use mime.type attribute
  • tar
  • zip
  • flowfile-stream-v3
  • flowfile-stream-v2
  • flowfile-tar-v1

View solution in original post

3 REPLIES 3

avatar
Expert Contributor

Hey Sunile,

I believe you are looking for the unpack content processor found here

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.UnpackContent/...

Allowable file types:

  • use mime.type attribute
  • tar
  • zip
  • flowfile-stream-v3
  • flowfile-stream-v2
  • flowfile-tar-v1

avatar

Using UnpackContent processor you can take the items out of tar or zip archives as individual flow files. Metadata about those objects will be retained on each flow file. You can then operate on those individual unpacked items to do what you need then you could if needed recombine them back into a zip or tar using the merge strategy of 'defragment'.

avatar

In addition to the UnpackContent processor suggested by @Chris Gambino, the CompressContent[1] processor has a "decompress" option which works on these compression formats:

  • use mime.type attribute
  • gzip
  • bzip2
  • xz-lzma2
  • lzma
  • snappy
  • snappy framed

[1]https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.CompressContent/index.html