---
title: "stdin: Collect messages from the standard input stream"
url: "https://axoflow.com/docs/axosyslog-core/4.28/chapter-sources/configuring-sources-stdin/"
last_modified: "2026-09-30T14:50:17+02:00"
---

> For the complete documentation index, see [llms.txt](https://axoflow.com/docs/axosyslog-core/4.28/llms.txt).

# stdin: Collect messages from the standard input stream

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

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

## Declaration

```shell
stdin();
```

For the list of available optional parameters, see [stdin() source options](https://axoflow.com/docs/axosyslog-core/4.28/chapter-sources/configuring-sources-stdin/stdin-source-options/index.md).

## Example: Using the stdin() driver

```shell
@version: 4.28
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:

```shell
$ 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
```

---

[stdin() source options](https://axoflow.com/docs/axosyslog-core/4.28/chapter-sources/configuring-sources-stdin/stdin-source-options/index.md)

Last modified September 30, 2026: [Fold small options pages into the main source page (3b62180c)](https://github.com/axoflow/axosyslog-core-docs/commit/3b62180c24b54091714b1e47056ce1ff25020ad7)
