使用flume收集日志到hbase,flume配置如下:
agent.sources = source1
agent.sinks = hbase1
agent.channels = channel1
agent.sources.source1.type = spooldir
agent.sources.source1.spoolDir = f:/logs/backup
agent.sources.source1.fileHeader = true
agent.sources.source1.channels = channel1
agent.sinks.hbase1.channel = channel1
# Configure Hbase Sink hbase1
agent.sinks.hbase1.type = hbase
agent.sinks.hbase1.batchSize = 5
agent.sinks.hbase1.table = log
agent.sinks.hbase1.columnFamily = info
agent.sinks.hbase1.serializer = org.apache.flume.sink.hbase.RegexHbaseEventSerializer
agent.sinks.hbase1.serializer.regex = (.*?\\s.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?)
agent.sinks.hbase1.serializer.colNames = log_time,project,module,level,mid,session_id,remote_ip,server_ip,location,messag