File Tail

The File Tail origin reads lines of data as they are written to an active file after reading related archived files in the same directory. File Tail generates a record for each line of data.

When you configure the File Tail origin, you define the full path to the active file, the naming convention for archived files, and the first archived file to process. These properties determine the set of files that are read and the order of processing.

For example, a File Tail origin is configured to tail a log called server.log, starting with server.log.1, expecting archived files named in reverse counter order. When the runs, it starts reading lines from the beginning of server.log.1, ignoring older files. When it reaches the end of server.log.1, it continues processing data in server.log. When it completes reading existing data in server.log, it tails incoming data for the file.

When you stop a , the File Tail origin notes where it stops reading. When you restart the , the origin continues processing from the line where it left off, even if it has been archived to a different file.

You can reset the originreset the originreset the origin for the File Tail origin. When you reset the origin, the File Tail origin treats all properties as if you are starting the for the first time - processing all requested files before continuing to the active file.

The File Tail origin generates record header attributes that enable you to use the origins of a record in processing.

The origin can generate events for an event stream. For more information about dataflow triggers and the event framework, see Dataflow Triggers Overview.

Note: If you use logrotate with the copytruncate option, use the Directory origin to process the rolled or archived files. The File Tail origin does not support copytruncate.