Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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

share|improve this question

migrated from Feb 19 '13 at 11:10

This question came from our site for professional and enthusiast programmers.

I have asked same question in severfault. I think this question belongs to severfault. – robert Feb 19 '13 at 6:18

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.