You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flume.apache.org by "Felix.徐" <yg...@gmail.com> on 2013/03/22 02:58:28 UTC

Can I use variables in config file?

Hi,

I'm wondering if I can use some variables in the config file so as to
specify sinks' HDFS directory dynamically according to the hostname of
deployed server. For example , I want to set the
agent.sinks.***.hdfs.path=hdfs://../flume/${hostname}/..., and the
${hostname} will be initialized as the hostname of that server while
starting up flume.

Re: Can I use variables in config file?

Posted by "Felix.徐" <yg...@gmail.com>.
I see, that variable will be substituted according to the content of each
event? I think that is beyond what I need.

Another question is that how to change the format of each event appendded
to the HDFS file?


2013/3/22 Zhiwen Sun <pe...@gmail.com>

> Hi Felix:
>
> do you want this?
>
> http://flume.apache.org/FlumeUserGuide.html#hdfs-sink
>
> where %{host} is the header named host.
>
> Furthermore, It support arbitrary header name.
>
> Zhiwen Sun
>
>
>
> On Fri, Mar 22, 2013 at 9:58 AM, Felix.徐 <yg...@gmail.com> wrote:
>
>> Hi,
>>
>> I'm wondering if I can use some variables in the config file so as to
>> specify sinks' HDFS directory dynamically according to the hostname of
>> deployed server. For example , I want to set the
>> agent.sinks.***.hdfs.path=hdfs://../flume/${hostname}/..., and the
>> ${hostname} will be initialized as the hostname of that server while
>> starting up flume.
>>
>>
>>
>

Re: Can I use variables in config file?

Posted by Zhiwen Sun <pe...@gmail.com>.
Hi Felix:

do you want this?

http://flume.apache.org/FlumeUserGuide.html#hdfs-sink

where %{host} is the header named host.

Furthermore, It support arbitrary header name.

Zhiwen Sun



On Fri, Mar 22, 2013 at 9:58 AM, Felix.徐 <yg...@gmail.com> wrote:

> Hi,
>
> I'm wondering if I can use some variables in the config file so as to
> specify sinks' HDFS directory dynamically according to the hostname of
> deployed server. For example , I want to set the
> agent.sinks.***.hdfs.path=hdfs://../flume/${hostname}/..., and the
> ${hostname} will be initialized as the hostname of that server while
> starting up flume.
>
>
>