My assumptions about the exec plugin:
Input: File content getting updated.
Output: As soon as the file under the observation gets modified, fluentd plugin starts emitting the contents in the form of the matched_tag to values. meaning the command would be executed as part of match tag.
What was my exepctation was, as part of the command i just do cat of the file which exec plugin passes as last argument. which i assumed would have my updated file contents along with the key type i define:
Eg:
Input file updates with content
fluentd fluent fluent
I have shell script which i call in exec just outputs the contents of the last passed argumented file name from exec.
I view the log file where the command output would be written and i see only something like this:
log 2014-03-13 06:20:52 log 2014-03-13 06:20:52 log 2014-03-13 06:20:52 log 2014-03-13 06:20:52
Where as in the /var/log/td-agent/td-agent.log i can see.
2014-03-13 11:50:52 +0530 log: {"log":"fluentd fluent5 fluent1"}
2014-03-13 11:50:52 +0530 log: {"log":"fluentd fluent6 fluent2"}
2014-03-13 11:50:52 +0530 log: {"log":"fluentd fluent7 fluent3"}
2014-03-13 11:50:52 +0530 log: {"log":"fluentd fluent8 fluent4"}
Isn't that expected similar thing from exec plugin that intermediate file path which is passed to command should be same as the log output?