From 7c146b977db88a4994d86d56ac55fc95aa710f9d Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 27 Nov 2010 16:02:09 +0700 Subject: [PATCH] FLUME-361: Allow specifying the output format to use with the dump command. --- bin/flume | 7 ++++++- src/docs/UserGuide/QuickStart | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/flume b/bin/flume index 4d1056e..6b4bfc9 100755 --- a/bin/flume +++ b/bin/flume @@ -270,8 +270,13 @@ elif [ "$CMD" = "unit4" ] ; then exec $FLUME org.junit.runner.JUnitCore "$@" elif [ "$CMD" = "dump" ] ; then # this has no error checking. be careful! + if [ -z "$2" ] ; then + CONSOLE="console" + else + CONSOLE="console(\"$2\")" + fi exec java $JOPTS $UOPTS com.cloudera.flume.agent.FlumeNode \ - -1 -s -r -n dump -c "dump: $1 | console; " + -1 -s -r -n dump -c "dump: $1 | $CONSOLE; " elif [ "$CMD" = "dumplog" ] ; then # this has no error checking. be careful! exec java $JOPTS $UOPTS com.cloudera.flume.agent.FlumeNode \ diff --git a/src/docs/UserGuide/QuickStart b/src/docs/UserGuide/QuickStart index ec20415..4393fec 100644 --- a/src/docs/UserGuide/QuickStart +++ b/src/docs/UserGuide/QuickStart @@ -49,8 +49,9 @@ you installed from the tarball package, the command can be found in should already be in your path. TIP: The example above uses the `dump` command and `console` is the argument. -The command’s syntax is `flume dump `. It prints data from ++ -to the console. +The command’s syntax is `flume dump []`. It prints data +from ++ to the console. Optionally, an output format can be specified, +otherwise the default text format is used. NOTE: Some flume configurations by default write to local disk. Initially the default is '/tmp/flume'. This is good for initial -- 1.7.3.2