Syslog NG - MacOS Testing
  • GSOC - Project Report
  • Testing Methodology
  • Testing Status
  • Installation
  • Modules
    • afsocket [17]
      • network() Source Driver
      • network() Destination Driver
      • syslog() Source/Destination Driver
      • unix-stream() Source Driver
      • unix-stream() Destination Driver
      • unix-dgram() Source/Destination Driver
      • TLS-Encryption
        • Using network()
        • Using syslog()
    • affile [6]
      • file() Source Driver
      • file() Destination Driver
      • pipe() Source Driver
      • pipe() Destination Driver
      • wildcard_file() Source Driver
      • stdin() Source Driver
    • afprog [2]
      • program() Source Driver
      • program() Destination Driver
    • system [1]
      • Collecting local logs pre macOS 10.15 Catalina
    • afuser [1]
    • pseudofile [1]
    • mod-python [7]
      • python() Source Driver
      • python-fetcher() Source Driver
      • python() Destination Driver*
    • afmongodb [1]
    • http [1]
    • riemann [1]
    • redis [1]
    • elasticsearch-http [1]
    • afsql [1]
    • afsmtp [1]
Powered by GitBook
On this page
  • Important Information
  • Status
  • How to Test

Was this helpful?

  1. Modules
  2. afprog [2]

program() Destination Driver

The program() driver starts an external application or script and sends the log messages to its standard input (stdin).

Important Information

Usually, every message is a single line (ending with a newline character), which your script can process. Make sure that your script runs in a loop and keeps reading the standard input — it should not exit. (If your script exits, syslog-ng OSE tries to restart it.)

Status

Architecture

Status

x86

Works

ARM

Works

How to Test

To test the program() destination driver, we will make a shell script that receives input and stores it into a file or displays it on the console. Then, using the program destination driver, we will pass a custom message to this script and see the results in the file.

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

Shell Script

#!/bin/sh
while read line ; do
echo $line >> /Users/yash/Documents/test.txt
done

Configuration File Used

@version: 3.31
@include "scl.conf"

source custom
{
    example-msg-generator(
        num(20)
        freq(2)
        template("Random Message")
    );
};

destination d_prog { 
    program("/Users/yash/Documents/script"); 
};


log {
    source(custom);
    destination(d_prog);
};

Proof

Previousprogram() Source DriverNextsystem [1]

Last updated 3 years ago

Was this helpful?

Testing program() destination on macOS (x86)
Testing program() destination on macOS (ARM)