Description
Is your feature request related to a problem? Please describe.
12 Factor app says we should push our log messages to stdout, which can be captured by Fluentd for example. However, using Fluentbit to capture stdout on stdin, as illustrated, only works if the incoming text is in a simple JSON format. This is very restrictive and constrains the stdin use case to a very small number of use cases.
Describe the solution you'd like
There are a couple of possible options:
- provide the option that allows the entire input to be captured as the log event using a defined delimiter character or characters (e.g. newline, linefeed, or any literal value
- for non JSON payloads, use a parser to determine what each record is
- option for a Lua parser to be incorporated to break the stdin stream into records
- Define the number of characters each record gets - while not ideal - it would make it possible to still capture a stdin stream of non JSON
I would suggest option 1 is the simplest option which wont compromise performance and would be relatively easy to introduce
Describe alternatives you've considered
See above
Additional context
A simple test scenario would be a variation of the stdin example so that the script-generating events might be:
#!/bin/sh
while :; do
echo -n "blah blah blah\n"
sleep 1
done
The configuration could then be:
[input]
name stdin
terminator \n
tag capture_non_json
we could then deploy and run along the lines of:
./script.sh | fluent-bit -c myConfig.conf
This would allow us to support the principles of the 12-factor app more elegantly. It would avoid having to pipe stdout to a log file and the issues of piping output would have with log rotation (or absence of)