Last active
May 25, 2016 02:34
-
-
Save joekiller/eb8794ad5f71c1430c54cd557ce642e5 to your computer and use it in GitHub Desktop.
Flume With Solr 6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example.conf: A single-node Flume configuration | |
# Name the components on this agent | |
a1.sources = r1 | |
a1.sinks = k1 | |
a1.channels = c1 | |
a1.sources.r1.type = spooldir | |
a1.sources.r1.channels = c1 | |
a1.sources.r1.spoolDir = /tmp/messages | |
a1.sources.r1.fileHeader = true | |
a1.sinks.k1.type = org.apache.flume.sink.solr.morphline.MorphlineSolrSink | |
a1.sinks.k1.channel = c1 | |
a1.sinks.k1.morphlineFile = conf/morphline.conf | |
# Use a channel which buffers events in memory | |
a1.channels.c1.type = memory | |
a1.channels.c1.capacity = 1000 | |
a1.channels.c1.transactionCapacity = 1000 | |
# Bind the source and sink to the channel | |
a1.sources.r1.channels = c1 | |
a1.sinks.k1.channel = c1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SOLR_LOCATOR: { | |
collection: gettingstarted | |
zkHost: "127.0.0.1:9893" | |
} | |
morphlines : [ | |
{ | |
id : morphline1 | |
importCommands : ["org.kitesdk.**", "org.apache.solr.**"] | |
commands : [ | |
{ | |
readLine { | |
charset : UTF-8 | |
} | |
} | |
{ | |
grok { | |
dictionaryString : """ | |
SPACE \s* | |
DATA .*? | |
GREEDYDATA .* | |
""" | |
expressions : { | |
message : """%{GREEDYDATA:id}""" | |
} | |
} | |
} | |
{ | |
sanitizeUnknownSolrFields { | |
solrLocator : ${SOLR_LOCATOR} | |
} | |
} | |
{ logInfo { format : "output record: {}", args : ["@{}"] } } | |
# load the record into a Solr server or MapReduce Reducer | |
{ | |
loadSolr { | |
solrLocator : ${SOLR_LOCATOR} | |
} | |
} | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://opensourceconnections.com/blog/2016/05/24/flume-with-solr-6-morphlines