> For the complete documentation index, see [llms.txt](https://syslog-macos-testing.gitbook.io/syslog-macos-testing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://syslog-macos-testing.gitbook.io/syslog-macos-testing/modules/afprog-2/program-source-driver.md).

# program() Source Driver

The program driver starts an external application and reads messages from the standard output (stdout) of the application.

### Status

| Architecture | Status |
| :----------: | :----: |
|      x86     |  Works |
|      ARM     |  Works |

### How to Test

The program() source driver is mainly useful to receive log messages from daemons that accept incoming messages and convert them to log messages. To stimulate this, we will write a shell script and run it using program() driver.&#x20;

> Note: The script is started by the driver, and in case of a exit, it is restarted automatically.

#### Shell Script

```
#!/bin/bash
while true
do
    echo "Hi"
    sleep 1
done
```

#### Configuration File Used

```
@version: 3.31
@include "scl.conf"

source s_program {
    program("/Users/yash/Documents/test.sh");
};

destination console{
    file(/dev/stdout);
};

log {
    source(s_program);
    destination(console);
};
```

#### Proof

![Program() Source Driver tested on macOS (x86)](https://3267548193-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaZdBoDvCx_0JwOUICk%2F-McEFubTgweCVcLulTv7%2F-McEIlO01mtoLMl9X5gb%2FScreenshot%202021-06-15%20at%201.45.21%20PM.png?alt=media\&token=daaac05b-5a39-4a1e-80dd-c118b0790982)

![Program() Source Driver tested on macOS (ARM)](https://3267548193-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaZdBoDvCx_0JwOUICk%2F-MhXn5_Uy8Ayiemsnkwk%2F-MhXo-XavluMMwd7QHhg%2FScreen%20Shot%202021-08-20%20at%2012.01.17%20PM.png?alt=media\&token=411fa0ef-3adc-4d5a-b522-ab25fbc161b2)
