Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

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

Super Guru

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

1 ACCEPTED SOLUTION

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

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

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'.

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

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.