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
  • Status
  • How to Test

Was this helpful?

  1. Modules
  2. affile [6]

file() Source Driver

The file() source driver is used to collect log messages from plain-text files, for example, from the logfiles of an Apache webserver.

Status

Architecture

Status

x86

Works

ARM

Works

How to Test

File() drivers are at the very core of syslog-ng. Chances are you are already using them for displaying output to your console. To test the file source driver, we will use it to display the contents of a file that we create.

Note: For this test, please create a new file and add a few lines of text in it. In this instance, we will assume the file is called "test.txt"

We can use the file() source driver as a source for log messages instead of internal() or system(). To do so, we just need to use:

source s_file {
    file("/var/log/messages");    #On Linux
    file("/var/log/system.log");  #On macOS
};

Configuration File Used

@version: 3.31
@include "scl.conf"

source s_file {
    file("/Users/yash/Documents/test.txt");
    #Enter your path here ^
};

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

log {
    source(s_file);
    destination(console);
};

Proof

Previousaffile [6]Nextfile() Destination Driver

Last updated 3 years ago

Was this helpful?

file() source driver tested on macOS (x86)
file() source driver tested on macOS (ARM)