Flume spooldir to get file metadata of source file -



Flume spooldir to get file metadata of source file -

i have requirement in each flume event have add together filename , file creationdate of file in spooldir directoy. have found can add together filename in header of event setting fileheader=true. simillarly can find file creation date writing custom interceptor ?

the file name set within spool source implementation:

if (annotatefilename) { string filename = currentfile.get().getfile().getabsolutepath(); (event event : events) { event.getheaders().put(filenameheader, filename); } }

that's specific implementation detail of source type. if want preserve originla file name, need set property, these available options:

fileheader false whether add together header storing absolute path filename. fileheaderkey file header key utilize when appending absolute path filename event header.

if want add together timestamp, can utilize built-in interceptors:

timestampinterceptor timestamp host interceptor flume instance's hostname staticinterceptor constant value.

flume flume-ng

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -