[
https://issues.apache.org/jira/browse/FLUME-2473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14160557#comment-14160557
]
Guyle Taber commented on FLUME-2473:
------------------------------------
Thanks Roshan,
Here's my flume.conf specific to the use of the shell option.
agent.sources = apache
agent.sources.apache.type = exec
agent.sources.apache.shell = /bin/bash -c
agent.sources.apache.command = tail -F
/usr/local/webserver-proxy/localhost/logs/access_log.`date +%Y%m%d`; done
agent.sources.apache.batchSize = 100
agent.sources.apache.channels = memoryChannel
However, when I fire up flume, the date command doesn't seem to be
interpolated.
06 Oct 2014 10:35:08,445 INFO [lifecycleSupervisor-1-3]
(org.apache.flume.source.ExecSource.start:155) - Exec source starting
with command:tail -F
/usr/local/webserver-proxy/localhost/logs/access_log.`date +%Y%m%d`; done
> Flume exec tail -f date on apache log - unix date formatting
> ------------------------------------------------------------
>
> Key: FLUME-2473
> URL: https://issues.apache.org/jira/browse/FLUME-2473
> Project: Flume
> Issue Type: Question
> Components: Configuration
> Affects Versions: v1.5.0.1
> Environment: CentOS 6.5
> Reporter: Guyle Taber
> Priority: Minor
>
> I'm trying to setup a flume source using the exec type and using tail -F on a
> log file that will be date stamped. The docs indicate typical unix commands
> would work, but date formatting for a file that's name changes each day
> doesn't seem to work.
> agent.sources.apache.command = tail -F
> /usr/local/apache/localhost/logs/access_log.`date +%Y%m%d`
> If I use "tail -F /usr/local/apache/localhost/logs/access_log.`date +%Y%m%d`"
> at the shell it works perfectly, but used inside the flume.conf for this
> source, I get nothing.
> Is there a way to use the unix date formatting in the source definition in
> flume.conf?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)