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
  • Compiling from source
  • Dependencies
  • Preparation
  • Getting the source
  • Configuration
  • Compile and Install
  • Run

Was this helpful?

Installation

How to compile syslog-ng on macOS. This guide includes specific instructions for macOS with Apple Silicon.

PreviousTesting StatusNextafsocket [17]

Last updated 1 year ago

Was this helpful?

At present, macOS syslog-ng is not supported on the official repository. However, you can compile it from the source using this guide.

Note: the guide is tested on ARM macOS Ventura 13.4, and Intel macOS Monterey 12.6.6 machines, your actual system may require additional steps or slightly different settings.

Compiling from source

Like every project syslog-ng also uses different libraries and build-systems that must be installed for compiling and running properly. These dependencies can be satisfied by compiling every-each libs and tools manually, but it might be preferred to do it the easy way. is a package manager for macOS that has great community and support. You can also use it to install the dependencies you need.

Dependencies

  1. on your system.

  • Don't forget to add homebrew to your path, follow the instructions in your terminal!

  • This will install Command Line Tools for Xcode as well if not already prresented on the system that would also be required anyway for a seamless syslog-ng build.

  1. Perform if you have not done it yet.

  2. Install the following dependencies:

    • automake

    • autoconf

    • autoconf-archive

    • binutils

    • bison

    • flex

    • gcc@11

    • glib

    • ivykis

    • json-c

    • libtool

    • pcre

    • pkg-config

    • openssl

    The following package(s) might be needed tas well depending on your macOS version and architecture

    • net-snmp

    Extra modules might require the following

    • hiredis

    • libdbi # see bellow!

    • libmaxminddb

    • libnet

    • librdkafka

    • mongo-c-driver

    • python3

    • rabbitmq-c

    • riemann-client

In the terminal all the above should look something like this

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

brew update

brew install \
    automake \
    autoconf \
    autoconf-archive \
    binutils \
    bison \
    flex \
    gcc@11 \
    glib \
    ivykis \
    json-c \
    libtool \
    pcre \
    pkg-config \
    openssl \
    #
    net-snmp \
    #
    hiredis \
    # libdbi - Do not use the homebrew provided one, see bellow!
    libmaxminddb \
    libnet \
    librdkafka \
    mongo-c-driver \
    python3 \
    rabbitmq-c \
    riemann-client
    
  • bison is required to be installed when using homebrew, because the options provided by Apple Developer Tools are incomplete. (for example: missing -W option) The reason is why bison is required to be installed from homebrew is that the -W option is supported only after 2.3.

  • net-snmp might be needed as well when using homebrew, because the options provided by Apple Developer Tools are bogus a bit. The reason is why net-snmp might be required from homebrew is that the by default provided pkgconfig might give back bogus lib and include values.

  • openssl - since macOS provides LibreSSL by default, we need to expand the search path of pkg-config to find the freshly installed openSSL, see bellow.

Preparation

  1. Depending your macOS architecture homebrew is using different location for storing its data, so worth using a generic reference to it

    export HOMEBREW_PREFIX=$(brew --prefix)
  2. Force the building process to use bison and net-snmp installed through homebrew instead of provided by Apple Developer Tools.

    • Option 1: add bison to $PATH

    export PATH=${HOMEBREW_PREFIX}/opt/bison/bin:${HOMEBREW_PREFIX}/opt/net-snmp/bin:${PATH}
    • Option 2: when configuring set the environmental variable $YACC to bison

    export YACC=${HOMEBREW_PREFIX}/opt/bison
  3. Extend the search path of pkg-config to use the homebrew version of openssl and net-snmp

    export PKG_CONFIG_PATH=${HOMEBREW_PREFIX}/opt/openssl/lib/pkgconfig:${HOMEBREW_PREFIX}/opt/net-snmp/lib/pkgconfig:${PKG_CONFIG_PATH}

Getting the source

To get the latest master from syslog-ng git you can use

cd YOUR_PREFERRED_WORKING_DIR   # Replace `YOUR_PREFERRED_WORKING_DIR` with your actual preferred working dir 
git clone https://github.com/syslog-ng/syslog-ng . 

Configuration

./autogen.sh
./configure --with-ivykis=system --disable-java

For a full feature set (excluded the not yet supported modules on macOS):

./autogen.sh
./configure --with-ivykis=system --enable-all-modules --disable-smtp --disable-mqtt --disable-java --enable-tests --enable-manpages
  • for various reasons not all modules can be configured, built, and used on all macOS versions and architectures, for details please see the Modules section of this document

Compile and Install

make -j4
make install

Optionally, you can specify the install prefix passing --prefix /example/installdir/ to the configure script.

Run

To start the service, you can either navigate to the syslog-ng folder where you've compiled it and run

./syslog-ng -F

Or, you can start the service with the official command:

/usr/local/sbin/syslog-ng

libdbi and libdbi-drivers are in syslog-ng OSE repositories, use the latest master version from there

is now offering MacOS ARM builds of OpenJDK on their website in the downloads section. This has not been tested, so your mileage may vary.

For options and more information, read the guide.

For more information read the guide and the syslog-ng

Homebrew
Install Homebrew
Azul
compile first
run first
documentation
maintained and updated