Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

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

migrated from stackoverflow.com Feb 19 '13 at 11:10

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

1 Answer

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
add comment

Your Answer

 
discard

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.