Host Interceptor gives localhost as hostname in aws

0

I'm trying to write my apache logs from my ec2 instances. I want the logs separated by hostname.

I'm using host interceptor to get the hostname. My configuration is below.

agent1.sources.spooldir-source1.interceptors = i1 hostname agent1.sources.spooldir-source1.interceptors.i1.type = timestamp agent1.sources.spooldir-source1.interceptors.hostname.type = host agent1.sources.spooldir-source1.interceptors.hostname.useIP = false agent1.sources.spooldir-source1.interceptors.hostname.preserveExisting = true

But, flume writes the logs to directory called localhost. This is not suitable for me.

I have not changed the default hostname of aws instance.

ie, If the default hostname is like the below one.

bitnami@ip-10-242-197-46:~$ hostname

ip-10-242-197-46

I want the logs to be written in a directory called ip-10-242-197-46 instead of localhost

robert

Posted 2013-02-18T08:56:51.420

Reputation: 101

I have asked same question in severfault. I think this question belongs to severfault. – robert – 2013-02-19T06:18:39.317

Answers

0

Answering my own question.

Changing the order of entries in /etc/hosts did the trick. I moved the entry for ip-10-242-197-46 to the top of host file. Hope this helps someone.

robert

Posted 2013-02-18T08:56:51.420

Reputation: 101