[ 
https://issues.apache.org/jira/browse/FLUME-2982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15447489#comment-15447489
 ] 

Mike Percy commented on FLUME-2982:
-----------------------------------

Sounds like a useful feature. Consider using syntax compatible with the 
existing stuff, but not to be confused with the header syntax.

Perhaps %(localhost) or something like that.

By the way, getting the hostname from the local machine isn't as easy as you 
might expect in Java. See the comments on this SO thread: 
http://stackoverflow.com/questions/7348711/recommended-way-to-get-hostname-in-java

Possibly the most reliable way is to shell out and execute {{hostname}} -- this 
sounds like it should be portable since you should end up with /bin/hostname on 
*Nix and HOSTNAME.EXE on Windows. See http://stackoverflow.com/a/28043703

This may be worth writing a utility function for that caches the result, 
possibly invalidating that cache when the sink is reconfigured or something 
like that.

> Add localhost escape sequence to HDFS sink
> ------------------------------------------
>
>                 Key: FLUME-2982
>                 URL: https://issues.apache.org/jira/browse/FLUME-2982
>             Project: Flume
>          Issue Type: Improvement
>            Reporter: Jeff Holoman
>            Assignee: Jeff Holoman
>
> It would be useful to be able to just use %localhost% escape sequence instead 
> of having to pass in a header / use the host interceptor. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to