syslog-ng documentation

Your main source of knowledge

The syslog-ng product family has an extensive documentation, covering everything from how to install a product to the most complex configuration and settings descriptions. If you cannot find an answer to your question, try the mailing list - our community is always eager to help.

syslog-ng Open Source Edition

Contents

6.20. stdin: Collecting messages from the standard input stream

The stdin() driver collects messages from the standard input stream. When the standard input stream is closed, syslog-ng stops and stdin() inherits all options from the file() source, including multi-line options, or flags(no-parse).

The stdin() driver causes syslog-ng to exit once it hits end-of-file (EOF).

Declaration: 

stdin(); 
Example 6.39. Using the stdin() driver
@version: 3.15
log { 
	source { stdin(); };
	destination { file("/dev/stdout"); };
};

The following code snippet is an example of how the stdin() driver is used to collect a test message:

$ echo "this is a test message" | ./syslog-ng -Fe --no-caps
[2017-11-14T13:47:16.757938] syslog-ng starting up; version='3.12.1'
[2017-11-14T13:47:16.758195] syslog-ng shutting down; version='3.12.1'
Nov 14 13:47:16 testserver this is a test message