Coder Social home page Coder Social logo

joe2hpimn / flume-sinks-safe-roll-file-sink Goto Github PK

View Code? Open in Web Editor NEW

This project forked from white-poto/flume-sinks-safe-roll-file-sink

0.0 2.0 0.0 49 KB

flume roll file sink 升级,支持移动文件、重命名文件

License: Apache License 2.0

Java 100.00%

flume-sinks-safe-roll-file-sink's Introduction

flume-safe-roll-file-sink

该插件已经在日TB级别的日志收集系统中持续运行了一年以上,可放心使用 flume roll file sink升级版,支持以下特性:

  • 支持针对已处理完成文件添加后缀
  • 支持已处理完成文件移动
  • 支持空文件删除(当进行文件移动或文件重命名时,如文件为空,则执行delete()操作)
  • 支持文件多路复制

配置参数:

  • sink.moveFile default:false 含义:是否移动文件
  • sink.targetDirectory default:'' 含义:移动目标目录
  • sink.useFileSuffix default:false 含义:是否添加文件后缀(移动和复制过程均会使用后缀名)
  • sink.fileSuffix default:.COMPLEATED 含义:文件后缀名
  • sink.useCopy default:false 含义:是否复制文件
  • sink.copyDirectory default:'' 含义:复制目标目录(多个目录请使用英文逗号分隔)

配置示例:

# 负载机flume client配置

# 组件名称配置
client.sources = source_client
client.sinks = sink_client
client.channels = channel_client

# 日志源组件配置(监听目录下新增文件)
client.sources.source_client.type = spooldir
client.sources.source_client.channels = channel_client
client.sources.source_client.spoolDir = /some_logs_dir/
client.sources.source_client.fileHeader = true

# sink组件配置
client.sinks.sink_client.type = cn.huyanping.flume.sinks.SafeRollingFileSink
client.sinks.sink_client.channel = channel_client
client.sinks.sink_client.sink.directory = /data/source
client.sinks.sink_client.sink.rollInterval = 1

client.sinks.sink_client.sink.moveFile = true
client.sinks.sink_client.sink.targetDirectory = /data/target

client.sinks.sink_client.sink.useFileSuffix = true
client.sinks.sink_client.sink.fileSuffix = .COMPLETED

client.sinks.sink_client.sink.useCopy = true
client.sinks.sink_client.sink.copyDirectory = /data/copy1,/data/copy2

# 文件管道设置
client.channels.channel_client.type = file
client.channels.channel_client.checkpointDir = /data/tmp/checkpoint
client.channels.channel_client.dataDirs = /data/tmp

flume-sinks-safe-roll-file-sink's People

Contributors

white-poto avatar

Watchers

杨刚 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.