Installation
How to compile syslog-ng on macOS. This guide includes specific instructions for macOS with Apple Silicon.
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. Homebrew is a package manager for macOS that has great community and support. You can also use it to install the dependencies you need.
Dependencies
Install Homebrew on your system.
Perform if you have not done it yet.
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
Preparation
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)
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
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
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
Last updated
Was this helpful?