Skip to content

Instantly share code, notes, and snippets.

@yarikc
Last active December 7, 2016 13:37
Show Gist options
  • Save yarikc/1866960a59de1cf3fa74 to your computer and use it in GitHub Desktop.
Save yarikc/1866960a59de1cf3fa74 to your computer and use it in GitHub Desktop.
Simple Flume tail to Kafka
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /var/log/example.log
a1.sources.r1.channels = c1
a1.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k1.topic = test
a1.sinks.k1.brokerList = localhost:9092
a1.sinks.k1.requiredAcks = 1
a1.sinks.k1.batchSize = 20
#a1.sinks.k1.serializer = org.apache.flume.serialization.HeaderAndBodyTextEventSerializer
#a1.sinks.k1.sink.serializer.appendNewline = false
# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 100
a1.channels.c1.transactionCapacity = 100
# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment