### Install Examples Library Source: https://github.com/axoflow/axosyslog/blob/main/modules/examples/CMakeLists.txt Installs the 'examples' library to the 'lib/syslog-ng' directory with the 'examples' component. This makes the example plugins available for use. ```cmake install(TARGETS examples LIBRARY DESTINATION lib/syslog-ng COMPONENT examples) ``` -------------------------------- ### Add Example Library Source: https://github.com/axoflow/axosyslog/blob/main/modules/examples/CMakeLists.txt Adds a shared library named 'examples' using the 'example-plugins.c' source file. This library serves as a central point for example plugins. ```cmake add_library(examples SHARED example-plugins.c) ``` -------------------------------- ### Installation and Configuration Files Source: https://github.com/axoflow/axosyslog/blob/main/CMakeLists.txt Configures and installs project-specific header files and directory structures. ```cmake configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/syslog-ng-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng-config.h) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng-config.h DESTINATION include/syslog-ng) install(DIRECTORY DESTINATION var) ``` -------------------------------- ### Install Library and Headers Source: https://github.com/axoflow/axosyslog/blob/main/lib/CMakeLists.txt Defines installation rules for the library binary, header files, and auxiliary tools. ```cmake install(TARGETS syslog-ng LIBRARY DESTINATION lib) install(FILES ${LIB_HEADERS} DESTINATION include/syslog-ng) install(FILES ${VALUE_PAIRS_HEADERS} DESTINATION include/syslog-ng/value-pairs) install(FILES ${COMPAT_HEADERS} DESTINATION include/syslog-ng/compat) install(FILES ${CONTROL_HEADERS} DESTINATION include/syslog-ng/control) install(FILES ${HEALTHCHECK_HEADERS} DESTINATION include/syslog-ng/healthcheck) install(FILES ${DEBUGGER_HEADERS} DESTINATION include/syslog-ng/debugger) install(FILES ${FILTER_HEADERS} DESTINATION include/syslog-ng/filter) install(FILES ${FILTERX_HEADERS} DESTINATION include/syslog-ng/filterx) install(FILES ${LOGMSG_HEADERS} DESTINATION include/syslog-ng/logmsg) install(FILES ${LOGPROTO_HEADERS} DESTINATION include/syslog-ng/logproto) install(FILES ${PARSER_HEADERS} DESTINATION include/syslog-ng/parser) install(FILES ${REWRITE_HEADERS} DESTINATION include/syslog-ng/rewrite) install(FILES ${STATS_HEADERS} DESTINATION include/syslog-ng/stats) install(FILES ${METRICS_HEADERS} DESTINATION include/syslog-ng/metrics) install(FILES ${TEMPLATE_HEADERS} DESTINATION include/syslog-ng/template) install(FILES ${TRANSPORT_HEADERS} DESTINATION include/syslog-ng/transport) install(FILES ${CSV_SCANNER_HEADERS} DESTINATION include/syslog-ng/scanner/csv-scanner) install(FILES ${LOGTHRDEST_HEADERS} DESTINATION include/syslog-ng/logthrdest) install(FILES ${LOGTHRSOURCE_HEADERS} DESTINATION include/syslog-ng/logthrsource) install(FILES ${SIGNAL_SLOT_CONNECTOR_HEADERS} DESTINATION include/syslog-ng/signal-slot-connector) set(TOOLS merge-grammar.py cfg-grammar.y ) install(FILES ${TOOLS} DESTINATION share/syslog-ng/tools) add_test_subdirectory(tests) ``` -------------------------------- ### Link Example Modules to Examples Library Source: https://github.com/axoflow/axosyslog/blob/main/modules/examples/CMakeLists.txt Links various example modules to the main 'examples' library. This ensures that the functionality provided by these modules is available to the examples library. ```cmake target_link_libraries(examples PRIVATE msg-generator) target_link_libraries(examples PRIVATE threaded-random-generator) target_link_libraries(examples PRIVATE threaded-diskq-source) target_link_libraries(examples PRIVATE example_filterx_func) if(ENABLE_CPP) target_link_libraries(examples PRIVATE random-choice-generator) endif() target_link_libraries(examples PRIVATE http-test-slots) target_link_libraries(examples PRIVATE tls-test-validation) target_link_libraries(examples PRIVATE example_destination) target_link_libraries(examples PRIVATE syslog-ng) ``` -------------------------------- ### Run AxoSyslog after installation Source: https://github.com/axoflow/axosyslog/blob/main/dbld/README.md Execute the installed binary with debug flags enabled. ```bash $ /install/sbin/syslog-ng -Fedv ``` -------------------------------- ### Define Example Destination Sources Source: https://github.com/axoflow/axosyslog/blob/main/modules/examples/destinations/example_destination/CMakeLists.txt Lists the header and source files for the example destination module. Ensure all necessary files are included. ```cmake set(example_destination_SOURCES "example_destination-parser.h" "example_destination-plugin.c" "example_destination-parser.c" "example_destination.h" "example_destination.c" "example_destination_worker.h" "example_destination_worker.c" ) ``` -------------------------------- ### Add Example Destination Module Source: https://github.com/axoflow/axosyslog/blob/main/modules/examples/destinations/example_destination/CMakeLists.txt Builds the example destination module as a static library. This is used when integrating into a larger module. ```cmake add_module( TARGET example_destination GRAMMAR example_destination-grammar SOURCES ${example_destination_SOURCES} LIBRARY_TYPE STATIC # STATIC: Built as part of a larger libexamples module ) ``` -------------------------------- ### Install Patterndb Update Script Source: https://github.com/axoflow/axosyslog/blob/main/scripts/CMakeLists.txt Configures and installs the update-patterndb script. It first copies a template file to the build directory and then installs the generated script to the bin destination. ```cmake configure_file (${CMAKE_CURRENT_SOURCE_DIR}/update-patterndb.in ${CMAKE_CURRENT_BINARY_DIR}/update-patterndb) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/update-patterndb DESTINATION bin) ``` -------------------------------- ### Debian Package Installation Files Source: https://github.com/axoflow/axosyslog/blob/main/packaging/README.md Create a `.install` file in Debian packaging to specify which files should be installed by debhelper. Use shell-like wildcard patterns. ```shell usr/lib/syslog-ng/*/libsecure-logging.so usr/bin/slog* ``` -------------------------------- ### Install AxoSyslog via APT Source: https://github.com/axoflow/axosyslog/blob/main/README.md Install the AxoSyslog package using the apt package manager. ```bash apt install axosyslog ``` -------------------------------- ### Enable Example Modules Source: https://github.com/axoflow/axosyslog/blob/main/modules/examples/CMakeLists.txt Conditionally enables example modules based on the ENABLE_EXAMPLE_MODULES CMake variable. If not enabled, the configuration returns early. ```cmake module_switch(ENABLE_EXAMPLE_MODULES "Enable example modules" ON) if(NOT ENABLE_EXAMPLE_MODULES) return() endif() ``` -------------------------------- ### Install Python Module Files Source: https://github.com/axoflow/axosyslog/blob/main/modules/python-modules/CMakeLists.txt Configures installation paths for Python source files and requirements. ```cmake install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/install/ DESTINATION ${CMAKE_INSTALL_PREFIX} PATTERN "*.py" ) install(FILES ${PROJECT_SOURCE_DIR}/requirements.txt DESTINATION "${CMAKE_INSTALL_PREFIX}/${SYSLOG_NG_PYTHON_MODULE_DIR}") ``` -------------------------------- ### Install AxoSyslog via Helm Source: https://github.com/axoflow/axosyslog/blob/main/charts/axosyslog/README.md Commands to add the AxoSyslog repository and install the chart into a Kubernetes cluster. ```bash helm repo add axosyslog https://axoflow.github.io/axosyslog helm repo update helm install --generate-name axosyslog/axosyslog ``` -------------------------------- ### Configure Installation Paths Source: https://github.com/axoflow/axosyslog/blob/main/scripts/CMakeLists.txt Sets CMake variables for installation directories like prefix, exec_prefix, bindir, sysconfdir, and localstatedir. These are used to determine where AxoSyslog components will be installed. ```cmake set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix ${SYSLOG_NG_PATH_EXECPREFIX}) set(bindir "${exec_prefix}/bin") set(sysconfdir ${SYSLOG_NG_PATH_SYSCONFDIR}) set(localstatedir ${SYSLOG_NG_PATH_LOCALSTATEDIR}) ``` -------------------------------- ### Install eventlog Library Source: https://github.com/axoflow/axosyslog/blob/main/lib/eventlog/CMakeLists.txt Installs the 'eventlog' target to the 'lib' directory. This makes the built library available for use by other projects or the system. ```cmake install(TARGETS eventlog DESTINATION lib) ``` -------------------------------- ### Include Example Subdirectories Source: https://github.com/axoflow/axosyslog/blob/main/modules/examples/CMakeLists.txt Includes subdirectories for various example components, such as message generators, threaded sources, and destinations. This allows for modular development and integration of different functionalities. ```cmake add_subdirectory(sources/msg-generator) add_subdirectory(sources/threaded-random-generator) add_subdirectory(sources/threaded-diskq-source) add_subdirectory(sources/random-choice-generator) add_subdirectory(inner-destinations/http-test-slots) add_subdirectory(inner-destinations/tls-test-validation) add_subdirectory(destinations/example_destination) add_subdirectory(filterx/example-filterx-func) ``` -------------------------------- ### Install Fedora dependencies Source: https://github.com/axoflow/axosyslog/blob/main/README.md Installs the dnf-plugins-core package required for Fedora systems. ```bash dnf install -y dnf-plugins-core ``` -------------------------------- ### Configure RPATH and Project Settings Source: https://github.com/axoflow/axosyslog/blob/main/CMakeLists.txt Sets up RPATH handling for the build and installation process and initializes the project. ```cmake cmake_minimum_required(VERSION 3.14) # use, i.e. don't skip the full RPATH for the build tree set(CMAKE_SKIP_BUILD_RPATH FALSE) # when building, don't use the install RPATH already # (but later on when installing) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") set(CMAKE_MACOSX_RPATH 1) # add the automatically determined parts of the RPATH # which point to directories outside the build tree to the install RPATH set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) project(axosyslog C) ``` -------------------------------- ### Configure dqtool Executable Source: https://github.com/axoflow/axosyslog/blob/main/modules/diskq/CMakeLists.txt Builds the dqtool utility and sets up its installation path and test directory. ```cmake add_executable(dqtool dqtool.c) target_link_libraries(dqtool PRIVATE m eventlog syslog-ng-disk-buffer) target_include_directories(dqtool PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) install(TARGETS dqtool RUNTIME DESTINATION bin COMPONENT diskq) add_test_subdirectory(tests) ``` -------------------------------- ### Build and Install Native Connector Library Source: https://github.com/axoflow/axosyslog/blob/main/modules/native/CMakeLists.txt Configures the pkg-config file and builds the static library when ENABLE_NATIVE is enabled. ```cmake if (ENABLE_NATIVE) set(PKG_CONFIG_EXEC_PREFIX "\${prefix}") set(PKG_CONFIG_LIBDIR "\${exec_prefix}/lib") set(PKG_CONFIG_LIBS "-L\${libdir} -lsyslog-ng-native-connector") configure_file (${PROJECT_SOURCE_DIR}/cmake/syslog-ng-native-connector.pc.cmake ${PROJECT_BINARY_DIR}/syslog-ng-native-connector.pc) install(FILES ${PROJECT_BINARY_DIR}/syslog-ng-native-connector.pc DESTINATION lib/pkgconfig COMPONENT native-connector) add_library(syslog-ng-native-connector STATIC ${NATIVE_SOURCES} ${NATIVE_HEADERS}) target_include_directories (syslog-ng-native-connector PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories (syslog-ng-native-connector PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(syslog-ng-native-connector PRIVATE syslog-ng) install(TARGETS syslog-ng-native-connector ARCHIVE DESTINATION lib/ COMPONENT native-connector) endif() ``` -------------------------------- ### Install Patterndb Directory Source: https://github.com/axoflow/axosyslog/blob/main/scripts/CMakeLists.txt Installs the patterndb.d directory to the etc/patterndb.d destination. This ensures that pattern database files are placed in the correct configuration location. ```cmake install(DIRECTORY DESTINATION etc/patterndb.d) ``` -------------------------------- ### Install Python Virtual Environment Script Source: https://github.com/axoflow/axosyslog/blob/main/scripts/CMakeLists.txt Configures and installs the syslog-ng-update-virtualenv script. It uses a template file and installs the generated script to the bin destination, enabling the creation of Python virtual environments. ```cmake configure_file (${CMAKE_CURRENT_SOURCE_DIR}/syslog-ng-update-virtualenv.in ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng-update-virtualenv @ONLY) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng-update-virtualenv DESTINATION bin) ``` -------------------------------- ### Install AxoSyslog package Source: https://github.com/axoflow/axosyslog/blob/main/README.md Installs the AxoSyslog package using the yum package manager. ```bash yum install -y axosyslog ``` -------------------------------- ### Use AxoSyslog as a base image Source: https://github.com/axoflow/axosyslog/blob/main/README.md Example of using the AxoSyslog image as a base in a Dockerfile. ```dockerfile FROM ghcr.io/axoflow/axosyslog:latest ``` -------------------------------- ### Example Java Destination Implementation Source: https://github.com/axoflow/axosyslog/blob/main/modules/java/README.md Implement a custom Java destination by extending `TextLogDestination`. Ensure the class is compiled and accessible. ```java import org.syslog_ng.*; public class TestClass extends TextLogDestination { public TestClass(long handle) { super(handle); } public boolean init() { System.out.println("START"); System.out.println("Initialize test destination"); return true; } public void deinit() { System.out.println("Deinitialize object"); } public boolean queue(String message) { System.out.println("This is queue!" + message); return true; } public boolean flush() { return true; } } ``` -------------------------------- ### Configure AlmaLinux 8 repositories Source: https://github.com/axoflow/axosyslog/blob/main/README.md Enables the powertools repository and installs the necessary yum plugin. ```bash yum install -u yum-plugin-copr yum config-manager --set-enabled powertools ``` -------------------------------- ### Configure APT Repository for AxoSyslog Source: https://github.com/axoflow/axosyslog/blob/main/README.md Commands to add the Axoflow APT repository to a Debian-based system, including GPG key setup. ```bash wget -qO - https://pkg.axoflow.io/axoflow-code-signing-pub.asc | gpg --dearmor > /usr/share/keyrings/axoflow-code-signing-pub.gpg echo "deb [signed-by=/usr/share/keyrings/axoflow-code-signing-pub.gpg] https://pkg.axoflow.io/apt stable ubuntu-resolute" | tee --append /etc/apt/sources.list.d/axoflow.list apt update ``` -------------------------------- ### Install HTTP Module Development Headers Source: https://github.com/axoflow/axosyslog/blob/main/modules/http/CMakeLists.txt Installs the development headers for the HTTP module to the appropriate include directory, making them available for external use or integration. ```cmake install(FILES ${HTTP_MODULE_DEV_HEADERS} DESTINATION include/syslog-ng/modules/http/) ``` -------------------------------- ### Configure advanced hypr-audit-trail source Source: https://github.com/axoflow/axosyslog/blob/main/modules/python-modules/syslogng/modules/hypr/README.md Comprehensive configuration example for the hypr-audit-trail driver including optional parameters like page size and skip lists. ```syslog-ng source s_hypr { hypr-audit-trail( url('https://.hypr.com') bearer-token('') page-size() initial-hours() application-skip-list('HYPRDefaultApplication', 'HYPRDefaultWorkstationApplication') log-level('INFO') flags() ignore-persistence() ); }; ``` -------------------------------- ### Loggen Command Line Options (C) Source: https://github.com/axoflow/axosyslog/blob/main/tests/loggen/loggen.md Example of defining command-line options for a loggen plugin using GOptionEntry. These options are appended to the main program's options and are used to configure plugin-specific behavior. ```c static GOptionEntry loggen_options[] = { { "inet", 'i', 0, G_OPTION_ARG_NONE, &inet_socket_i, "Use IP-based transport (TCP, UDP)", NULL }, { "unix", 'x', 0, G_OPTION_ARG_NONE, &unix_socket_x, "Use UNIX domain socket transport", NULL }, { "stream", 'S', 0, G_OPTION_ARG_NONE, &sock_type_s, "Use stream socket (TCP and unix-stream)", NULL }, { "ipv6", '6', 0, G_OPTION_ARG_NONE, &use_ipv6, "Use AF_INET6 sockets instead of AF_INET (can use both IPv4 & IPv6)", NULL }, { "dgram", 'D', 0, G_OPTION_ARG_NONE, &sock_type_d, "Use datagram socket (UDP and unix-dgram)", NULL }, { NULL } }; ``` -------------------------------- ### Create Newsfile Entry Source: https://github.com/axoflow/axosyslog/blob/main/news/README.md Follow these steps to create a newsfile entry. Ensure file names follow the pattern `-.md` or `--.md` for multiple entries. Content should be concise markdown, with lines under 120 characters, starting with affected modules. ```bash news: - ``` -------------------------------- ### Configure Threaded Random Generator Source Source: https://github.com/axoflow/axosyslog/blob/main/modules/examples/sources/threaded-random-generator/README.md Example configuration for the `example-random-generator` source plugin. Specify the number of bytes, frequency, and type of random data. ```axosyslog source s_generator { example-random-generator( bytes(32) freq(0.5) type(random) ); }; log { source(s_generator); destination { file("/dev/stdout"); }; }; ``` -------------------------------- ### AxoSyslog Debian Package Module Installation Pattern Source: https://github.com/axoflow/axosyslog/blob/main/modules/python-modules/README.md Use this pattern in the .install file to specify which files of your Python module should be included in the AxoSyslog Debian package. ```shell usr/lib/syslog-ng/python/syslogng/modules//* ``` -------------------------------- ### Set Syslog-ng Version and Path Variables Source: https://github.com/axoflow/axosyslog/blob/main/CMakeLists.txt Defines versioning and installation directory paths for the syslog-ng project. ```cmake execute_process(COMMAND ${PROJECT_SOURCE_DIR}/scripts/version.sh SET OUTPUT_VARIABLE SYSLOG_NG_VERSION) set(SYSLOG_NG_COMBINED_VERSION ${SYSLOG_NG_VERSION}) set(SYSLOG_NG_SOURCE_REVISION ${SYSLOG_NG_VERSION}) set(SYSLOG_NG_PATH_PREFIX ${CMAKE_INSTALL_PREFIX}) set(SYSLOG_NG_PATH_SYSCONFDIR "\${prefix}/etc") set(SYSLOG_NG_PATH_DATADIR "\${datarootdir}") set(SYSLOG_NG_PATH_PKGDATADIR "\${datarootdir}/syslog-ng") set(SYSLOG_NG_PATH_PIDFILEDIR "\${localstatedir}") set(SYSLOG_NG_PATH_LOCALSTATEDIR "\${prefix}/var") set(SYSLOG_NG_MODULE_PATH "\${exec_prefix}/lib/syslog-ng") set(SYSLOG_NG_PATH_EXECPREFIX "\${prefix}") set(SYSLOG_NG_PATH_CONFIG_INCLUDEDIR "\${datadir}/syslog-ng/include") set(SYSLOG_NG_PATH_SCLDIR "\${datadir}/syslog-ng/include/scl") set(SYSLOG_NG_PATH_LIBEXECDIR "\${exec_prefix}/libexec") set(SYSLOG_NG_PATH_DATAROOTDIR "\${prefix}/share") set(SYSLOG_NG_ENABLE_TCP_WRAPPER 0) set(SYSLOG_NG_ENABLE_GPROF 0) set(SYSLOG_NG_ENABLE_MEMTRACE 0) set(SYSLOG_NG_ENABLE_SYSTEMD 0) set(SYSLOG_NG_PATH_MODULEDIR "\${exec_prefix}/lib/syslog-ng") set(SYSLOG_NG_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") set(SYSLOG_NG_PATH_XSDDIR "\${datadir}/syslog-ng/xsd") set(SYSLOG_NG_JAVA_MODULE_PATH "\${exec_prefix}/lib/syslog-ng/java-modules") set(SYSLOG_NG_PYTHON_MODULE_DIR "\${exec_prefix}/lib/syslog-ng/python") set(SYSLOG_NG_PYTHON_SYSCONF_MODULE_DIR "\${prefix}/etc/python") set(SYSLOG_NG_PYTHON_VENV_DIR "\${localstatedir}/python-venv") set(SYSLOG_NG_PATH_TOPSRC_DIR "${PROJECT_SOURCE_DIR}") set(LIBDIR "\${exec_prefix}/lib") set(INCLUDEDIR "\${prefix}/include") set(TOOLSDIR "\${datadir}/syslog-ng/tools") set (LOGGEN_PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/syslog-ng/loggen") ``` -------------------------------- ### Set BigQuery Target Installation Properties Source: https://github.com/axoflow/axosyslog/blob/main/modules/grpc/bigquery/CMakeLists.txt Configures the runtime path (RPATH) for the 'bigquery' target to include the installation's lib directory and a specific syslog-ng lib subdirectory. ```cmake set_target_properties(bigquery PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib/syslog-ng") ``` -------------------------------- ### Set Target Properties Source: https://github.com/axoflow/axosyslog/blob/main/modules/grpc/clickhouse/CMakeLists.txt Configures the installation RPATH for the clickhouse target. ```cmake set_target_properties(clickhouse PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib/syslog-ng") ``` -------------------------------- ### Configure syslog-ng-ctl build with CMake Source: https://github.com/axoflow/axosyslog/blob/main/syslog-ng-ctl/CMakeLists.txt Defines source files, links required libraries, and sets installation rules for the syslog-ng-ctl executable. ```cmake set(SYSLOG_NG_CTL_SOURCES syslog-ng-ctl.c control-client.h commands/attach.h commands/attach.c commands/commands.h commands/commands.c commands/credentials.h commands/credentials.c commands/verbose.h commands/verbose.c commands/log-level.h commands/log-level.c commands/ctl-stats.h commands/ctl-stats.c commands/query.h commands/query.c commands/license.h commands/license.c commands/config.h commands/config.c commands/healthcheck.h commands/healthcheck.c control-client.c ) add_executable(syslog-ng-ctl ${SYSLOG_NG_CTL_SOURCES}) target_link_libraries(syslog-ng-ctl PRIVATE syslog-ng secret-storage GLib::GLib ${RESOLV_LIBS}) target_include_directories(syslog-ng-ctl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) install(TARGETS syslog-ng-ctl RUNTIME DESTINATION sbin) ``` -------------------------------- ### Install and Uninstall AxoSyslog via Helm Source: https://github.com/axoflow/axosyslog/blob/main/README.md Commands to deploy or remove the AxoSyslog chart from a Kubernetes cluster. ```bash helm install my-axosyslog axosyslog/axosyslog ``` ```bash helm delete my-axosyslog ``` -------------------------------- ### Configure loggen_ssl_plugin with CMake Source: https://github.com/axoflow/axosyslog/blob/main/tests/loggen/ssl_plugin/CMakeLists.txt Defines the build process for the loggen_ssl_plugin library, including source files, dependencies, and installation paths. ```cmake include_directories(loggen_ssl_plugin ${CORE_INCLUDE_DIRS} ${LOGGEN_INCLUDE_DIR} ) set (LOGGEN_SSL_PLUGIN_SOURCE ssl_plugin.c ${LOGGEN_INCLUDE_DIR}/loggen_plugin.h ${LOGGEN_INCLUDE_DIR}/loggen_plugin.c ) add_library(loggen_ssl_plugin SHARED ${LOGGEN_SSL_PLUGIN_SOURCE} ) target_link_libraries( loggen_ssl_plugin loggen_helper GLib::GLib GLib::GModule GLib::GThread OpenSSL::SSL ) set_target_properties(loggen_ssl_plugin PROPERTIES VERSION ${SYSLOG_NG_VERSION} SOVERSION ${SYSLOG_NG_VERSION}) install(TARGETS loggen_ssl_plugin LIBRARY DESTINATION ${LOGGEN_PLUGIN_INSTALL_DIR}) ``` -------------------------------- ### Configure loggen_socket_plugin library with CMake Source: https://github.com/axoflow/axosyslog/blob/main/tests/loggen/socket_plugin/CMakeLists.txt Defines the shared library target, links it against loggen_plugin, sets version properties, and specifies the installation directory. ```cmake set (LOGGEN_SOCKET_PLUGIN_SOURCE socket_plugin.c) add_library(loggen_socket_plugin SHARED ${LOGGEN_SOCKET_PLUGIN_SOURCE} ) target_link_libraries(loggen_socket_plugin loggen_plugin) set_target_properties(loggen_socket_plugin PROPERTIES VERSION ${SYSLOG_NG_VERSION} SOVERSION ${SYSLOG_NG_VERSION}) install(TARGETS loggen_socket_plugin LIBRARY DESTINATION ${LOGGEN_PLUGIN_INSTALL_DIR}) ``` -------------------------------- ### Configure syslog-ng executable with CMake Source: https://github.com/axoflow/axosyslog/blob/main/syslog-ng/CMakeLists.txt Defines the source files, executable target, linking requirements, and installation destination for the syslog-ng binary. ```cmake set(syslog_ng_bin_sources main.c) add_executable(syslog-ng-bin ${syslog_ng_bin_sources}) SET_TARGET_PROPERTIES(syslog-ng-bin PROPERTIES OUTPUT_NAME syslog-ng) link_directories(${CMAKE_CURRENT_BINARY_DIR}/lib/) target_link_libraries(syslog-ng-bin syslog-ng) install(TARGETS syslog-ng-bin RUNTIME DESTINATION sbin) ``` -------------------------------- ### Display help for dbld/rules Source: https://github.com/axoflow/axosyslog/blob/main/dbld/README.md Access the general entrypoint for the build tool to list available targets. ```bash whoami@host:~/axosyslog$ dbld/rules [help] ``` -------------------------------- ### Add a Static Library Module Source: https://github.com/axoflow/axosyslog/blob/main/modules/metrics-probe/filterx/CMakeLists.txt Use `add_module()` to define a new module. Specify the target name, source files, and library type. This example adds a static library. ```cmake add_module( TARGET metrics-probe-filterx SOURCES ${METRICS_PROBE_FILTERX_SOURCES} LIBRARY_TYPE STATIC ) ``` -------------------------------- ### Configure HTTP Destination Source: https://github.com/axoflow/axosyslog/blob/main/modules/http/README.md Example configuration for sending logs via HTTP POST or PUT requests. Supports custom headers, user agent, authentication, and body content. ```syslog-ng configuration @version: 3.28 @include "scl.conf" source s_system { system(); internal(); }; destination http_des { http( url("http://127.0.0.1:8000") method("PUT") user_agent("syslog-ng User Agent") user("user") password("password") headers("HEADER1: header1", "HEADER2: header2") body("${ISODATE} ${MSG}") ); }; log { source(s_system); destination(http_des); }; ``` -------------------------------- ### Configure Additional Build Options Source: https://github.com/axoflow/axosyslog/blob/main/CMakeLists.txt Initializes OpenSSL, PCRE2, TCP wrappers, and spoof source support. ```cmake include(openssl_functions) openssl_set_defines() pkg_check_modules(LIBPCRE REQUIRED IMPORTED_TARGET libpcre2-8) option (ENABLE_TCP_WRAPPER "Enable TCP wrapper support" ${WRAP_FOUND}) set (SYSLOG_NG_ENABLE_TCP_WRAPPER ${ENABLE_TCP_WRAPPER}) set(ENABLE_SPOOF_SOURCE "auto" CACHE STRING "Enable spoof source support: ON, OFF, auto") set_property(CACHE ENABLE_SPOOF_SOURCE PROPERTY STRINGS auto ON OFF) message(STATUS "Checking Spoof source support") ``` -------------------------------- ### Print Configuration Summary Source: https://github.com/axoflow/axosyslog/blob/main/CMakeLists.txt Includes and executes the script to display the final build configuration summary. ```cmake include(print_config_summary) print_config_summary() ``` -------------------------------- ### Set Install RPATH for Pub/Sub Module Source: https://github.com/axoflow/axosyslog/blob/main/modules/grpc/pubsub/CMakeLists.txt Configures the installation runtime path (RPATH) for the 'pubsub' target to include specific library directories. ```cmake set_target_properties(pubsub PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib/syslog-ng") ``` -------------------------------- ### Define threaded-diskq-source library and dependencies Source: https://github.com/axoflow/axosyslog/blob/main/modules/examples/sources/threaded-diskq-source/CMakeLists.txt Configures the static library, links required syslog-ng components, and sets include directories. ```cmake add_library(threaded-diskq-source STATIC threaded-diskq-source-parser.c threaded-diskq-source-parser.h threaded-diskq-source.c threaded-diskq-source.h ${CMAKE_CURRENT_BINARY_DIR}/threaded-diskq-source-grammar.c ${CMAKE_CURRENT_BINARY_DIR}/threaded-diskq-source-grammar.h ) target_link_libraries(threaded-diskq-source PUBLIC syslog-ng PRIVATE syslog-ng-disk-buffer) target_include_directories(threaded-diskq-source PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ) ``` -------------------------------- ### Add Nightly APT Repository Source: https://github.com/axoflow/axosyslog/blob/main/README.md Configure the system to use the nightly build repository for AxoSyslog. ```bash echo "deb [signed-by=/usr/share/keyrings/axoflow-code-signing-pub.gpg] https://pkg.axoflow.io/apt nightly ubuntu-resolute" | tee --append /etc/apt/sources.list.d/axoflow.list ``` -------------------------------- ### Configure Disk Queue Source Source: https://github.com/axoflow/axosyslog/blob/main/modules/examples/sources/threaded-diskq-source/README.md Use this configuration to set up a disk queue source that reads from a specified file. Ensure the file path is correct. ```syslog-ng-config source s_diskq { example-diskq-source(file("/var/disk-buffers/syslog-ng-00000.rqf")); }; log { source(s_diskq); destination { file("/dev/stdout"); }; }; ``` -------------------------------- ### Configure secret-storage library in CMake Source: https://github.com/axoflow/axosyslog/blob/main/lib/secret-storage/CMakeLists.txt Defines the shared library target, its dependencies, and installation rules. ```cmake set(SECRET_STORAGE_SOURCES secret-storage.c nondumpable-allocator.c) set(SECRET_STORAGE_HEADERS secret-storage.h nondumpable-allocator.h) add_library(secret-storage SHARED ${SECRET_STORAGE_SOURCES}) target_include_directories(secret-storage PRIVATE # workaround, "compat" should be a separate static library ${PROJECT_SOURCE_DIR}/lib ) target_link_libraries(secret-storage PRIVATE GLib::GLib) set_target_properties(secret-storage PROPERTIES C_VISIBILITY_PRESET hidden) install(TARGETS secret-storage LIBRARY DESTINATION lib) install(FILES ${SECRET_STORAGE_HEADERS} DESTINATION include/syslog-ng) add_test_subdirectory(tests) ``` -------------------------------- ### Configure and Enable Process Accounting Module Source: https://github.com/axoflow/axosyslog/blob/main/modules/pacctformat/CMakeLists.txt Defines source files and conditionally adds the pacctformat module if the system is Linux and the feature is enabled. ```cmake set(PACCT_FORMAT_SOURCES pacct-format.c pacct-format.h pacct-format-plugin.c ) if (CMAKE_SYSTEM_NAME STREQUAL Linux) set(IS_LINUX "ON") else() set(IS_LINUX "OFF") endif() module_switch(ENABLE_PACCT "Enable support for reading Process Accounting files (EXPERIMENTAL, Linux only)." IS_LINUX) if (ENABLE_PACCT) add_module( TARGET pacctformat SOURCES ${PACCT_FORMAT_SOURCES} ) endif() ``` -------------------------------- ### Define Light Self-Check Target Source: https://github.com/axoflow/axosyslog/blob/main/tests/light/CMakeLists.txt Creates a custom target to install dependencies and run unit tests for the light component. ```cmake add_custom_target(light-self-check COMMAND ${LIGHT_POETRY_CMD} install COMMAND ${LIGHT_PYTEST_CMD} ${LIGHT_SOURCE_DIR}/src/axosyslog_light) ``` -------------------------------- ### Perform manual build in devshell Source: https://github.com/axoflow/axosyslog/blob/main/dbld/README.md Enter a development shell container to manually configure, build, and test AxoSyslog. ```bash $ ./dbld/rules shell-devshell # inside the container $ cd /source/ # autogen.sh generates the configure script using autotools, you could also # use cmake (alternative build system, experimental) here. $ ./autogen.sh $ cd /build/ # run the configure script, there's a wrapper for this in /dbld/bootstrap # that will include extra options exported by dbld/rules. $ /source/configure --enable-debug --prefix=/install $ make $ make check $ make install ``` -------------------------------- ### Automate version bumps Source: https://github.com/axoflow/axosyslog/blob/main/dbld/README.md Use the prepare-release target to update version strings across the source tree. ```bash $ ./dbld/rules prepare-release VERSION=3.28.1 ``` -------------------------------- ### Set C++ Target Properties Source: https://github.com/axoflow/axosyslog/blob/main/modules/grpc/pubsub/filterx/CMakeLists.txt Applies specific compile flags to a C++ target. This example disables specific deprecation warnings. ```cmake set_target_properties(pubsub_filterx_message_cpp PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations") ``` -------------------------------- ### Configure AlmaLinux 9+ repositories Source: https://github.com/axoflow/axosyslog/blob/main/README.md Enables the Code Ready Builder (crb) repository. ```bash dnf config-manager --set-enabled crb ``` -------------------------------- ### Configure Helm Chart Documentation Template Source: https://github.com/axoflow/axosyslog/blob/main/charts/docs/README.md Commands to link the standard documentation template to a specific chart directory. ```bash cd charts/CHART ls -s ../docs/templates/README.md.gotmpl ``` -------------------------------- ### Perform an official release Source: https://github.com/axoflow/axosyslog/blob/main/dbld/README.md Execute the release target to build artifacts and tag the current commit. ```bash $ ./dbld/rules release VERSION=3.28.1 ``` -------------------------------- ### View Logs Sent to Kafka with kafkacat Source: https://github.com/axoflow/axosyslog/blob/main/modules/kafka/README.md Use this command to consume and view messages from the 'syslog-ng' Kafka topic. Ensure kafkacat is installed. ```bash kafkacat -C -u -b localhost -t syslog-ng ``` -------------------------------- ### Runtime Environment Configuration Source: https://github.com/axoflow/axosyslog/blob/main/CMakeLists.txt Allows setting the LD_LIBRARY_PATH via an option. ```cmake option(ENV_LD_LIBRARY_PATH "Set LD_LIBRARY_PATH during runtime to the value given" "") if (ENV_LD_LIBRARY_PATH) set(SYSLOG_NG_ENABLE_ENV_WRAPPER 1) endif() ``` -------------------------------- ### Initialize InstantAckTracker Source: https://github.com/axoflow/axosyslog/blob/main/modules/python-modules/README.md Initialize InstantAckTracker in the init method, passing self.message_acked as the ACK callback. This strategy provides faster performance by not preserving original message ordering. ```python class MyFetcher(LogFetcher): ... def init(self, options): self.ack_tracker = InstantAckTracker(ack_callback=self.message_acked) return True def message_acked(self, acked_message_bookmark): pass ``` -------------------------------- ### Configure Library Build and Dependencies Source: https://github.com/axoflow/axosyslog/blob/main/libtest/CMakeLists.txt Defines the static library target, links necessary dependencies, and sets include directories. ```cmake add_library(libtest STATIC ${LIBTEST_SOURCES}) target_link_libraries(libtest syslog-ng ${CRITERION_LIBRARIES}) target_include_directories(libtest INTERFACE ${PROJECT_SOURCE_DIR}) add_test_subdirectory(tests) ``` -------------------------------- ### Configure Python Module Build Targets Source: https://github.com/axoflow/axosyslog/blob/main/modules/python-modules/CMakeLists.txt Defines custom targets for building and installing Python modules, ensuring dependencies on virtual environments are met. ```cmake module_switch(ENABLE_PYTHON_MODULES "Enable Python based modules" ENABLE_PYTHON) if (NOT ENABLE_PYTHON_MODULES) return() endif () if (NOT ENABLE_PYTHON) message(FATAL_ERROR "Python based modules enabled, but the required syslog-ng Python plugin is disabled.") endif() add_custom_target(BuildPyModules COMMAND ${PYTHON_VENV_EXECUTABLE} setup.py build --build-base=${CMAKE_CURRENT_BINARY_DIR}/build WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS BuildPyVirtualEnv VERBATIM ) add_custom_target(SetupPyModules COMMAND ${PYTHON_VENV_EXECUTABLE} setup.py install --root=/ --install-lib=${CMAKE_CURRENT_BINARY_DIR}/install/lib/syslog-ng/python WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS BuildPyModules VERBATIM ) ``` -------------------------------- ### Configure and Build stardate Module Source: https://github.com/axoflow/axosyslog/blob/main/modules/stardate/CMakeLists.txt Uses module_switch to toggle the stardate plugin and add_module to define the build target with its dependencies. ```cmake module_switch(ENABLE_STARDATE "Enable stardate") if (NOT ENABLE_STARDATE) return() endif() set(stardate_SOURCES stardate-plugin.c) add_module( TARGET stardate DEPENDS m SOURCES ${stardate_SOURCES} ) add_test_subdirectory(tests) ``` -------------------------------- ### Define Plugin Sources and Build Module Source: https://github.com/axoflow/axosyslog/blob/main/scripts/plugin-skeleton-creator/plugin_template_CMakeLists.txt Specify the source files for the plugin and add it as a module. This includes header and source files for the parser and plugin logic. ```AxoSyslog Configuration set(@PLUGIN_NAME_USUC@_SOURCES @PLUGIN_NAME@-parser.h @PLUGIN_NAME@-plugin.c @PLUGIN_NAME@-parser.c ) add_module( TARGET @PLUGIN_NAME_US@ GRAMMAR @PLUGIN_NAME@-grammar SOURCES ${@PLUGIN_NAME_USUC@_SOURCES} ) ``` -------------------------------- ### Configure JSON Plugin Enablement Source: https://github.com/axoflow/axosyslog/blob/main/modules/json/CMakeLists.txt Conditionally find and enable the JSONC library based on the ENABLE_JSON variable. This setup is typical for build systems that allow feature toggling. ```cmake if (NOT DEFINED ENABLE_JSON OR ENABLE_JSON) external_or_find_package(JSONC) endif() module_switch(ENABLE_JSON "Enable JSON plugin" JSONC_FOUND) if (NOT ENABLE_JSON) return() endif() ``` -------------------------------- ### Generate pkg-config File Source: https://github.com/axoflow/axosyslog/blob/main/CMakeLists.txt Sets variables for pkg-config and generates the .pc file for the project. ```cmake set(PKG_CONFIG_EXEC_PREFIX ${SYSLOG_NG_PATH_EXECPREFIX}) set(PKG_CONFIG_DATAROOTDIR ${SYSLOG_NG_PATH_DATAROOTDIR}) set(PKG_CONFIG_DATADIR ${SYSLOG_NG_PATH_DATAROOTDIR}) set(PKG_CONFIG_LIBDIR ${LIBDIR}) set(PKG_CONFIG_INCLUDEDIR ${INCLUDEDIR}) set(PKG_CONFIG_TOOLSDIR ${TOOLSDIR}) set(PKG_CONFIG_MODULEDIR ${SYSLOG_NG_PATH_MODULEDIR}) set(PKG_CONFIG_CONFIG_INCLUDEDIR ${SYSLOG_NG_PATH_CONFIG_INCLUDEDIR}) set(PKG_CONFIG_SCLDIR ${SYSLOG_NG_PATH_SCLDIR}) set(PKG_CONFIG_IVYKIS ${IVYKIS_INCLUDE_DIRS}) set(PKG_CONFIG_PACKAGE_VERSION ${SYSLOG_NG_VERSION}) set(PKG_CONFIG_INTERNAL_IVYKIS_CFLAGS ${IVYKIS_INCLUDE_DIRS}) set(libdir "${libdir}") set(includedir "${includedir}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/syslog-ng.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng.pc) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng.pc DESTINATION lib/pkgconfig) ``` -------------------------------- ### Generate NEWS.md File Source: https://github.com/axoflow/axosyslog/blob/main/news/README.md Run this script to create the NEWS.md file. Ensure the version in the `VERSION` file is updated before execution. ```python python3 news/create-newsfile.py ``` -------------------------------- ### Configure Threading and Python Environment Source: https://github.com/axoflow/axosyslog/blob/main/CMakeLists.txt Sets up threading preferences and detects the Python interpreter and libraries. ```cmake set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) set(SYSLOG_NG_HAVE_INOTIFY "${Inotify_FOUND}") set (PYTHON_VERSION "AUTO" CACHE STRING "Version of the installed development library" ) if ("${PYTHON_VERSION}" STREQUAL "AUTO") find_package(PythonInterp EXACT 3) find_package(PythonLibs EXACT 3) else () find_package(PythonInterp EXACT "${PYTHON_VERSION}" REQUIRED) find_package(PythonLibs EXACT "${PYTHON_VERSION}" REQUIRED) endif () MESSAGE(STATUS "Detected pythonlib version: ${PYTHONLIBS_VERSION_STRING}") include(python_build_venv) ``` -------------------------------- ### Configure AxoSyslog to Send to Kafka Source: https://github.com/axoflow/axosyslog/blob/main/modules/kafka/README.md This configuration sends messages to a Kafka topic named 'syslog-ng' using Logstash's JSON event layout. Ensure librdkafka is installed and compiled with `--with-librdkafka`. ```syslog-ng source s_system { system(); }; destination d_kafka { channel { rewrite { set("${HOST}" value(".eventv1.host")); set("1" value(".eventv1.@version")); set("${ISODATE}" value(".eventv1.@timestamp") condition("${.eventv1.@timestamp}" eq "")); set("${MESSAGE}" value(".eventv1.message") condition("${.eventv1.message}" eq "")); set("${MSG}" value(".eventv1.message") condition("${.eventv1.message}" eq "")); set("generic" value(".eventv1.type") condition("${.eventv1.type}" eq "")); }; destination { kafka-c(config(metadata.broker.list("localhost:9092") queue.buffering.max.ms("1000")) topic("test") message("$(format-json --key .eventv1.* --rekey .eventv1.* --shift 9)")); }; }; }; log { source(s_system); destination(d_kafka); }; ``` -------------------------------- ### Configure Python Virtual Environment Variables Source: https://github.com/axoflow/axosyslog/blob/main/scripts/CMakeLists.txt Sets CMake variables related to Python, including the virtual environment directory, module directory, and the Python executable path. These are essential for building and installing Python components. ```cmake set(python_venvdir ${SYSLOG_NG_PYTHON_VENV_DIR}) set(python_moduledir ${SYSLOG_NG_PYTHON_MODULE_DIR}) set(PYTHON ${PYTHON_EXECUTABLE}) ``` -------------------------------- ### Configure Java Module Build Process in CMake Source: https://github.com/axoflow/axosyslog/blob/main/modules/java-modules/CMakeLists.txt This script detects Gradle, sets up build paths, and defines custom targets to build and install Java modules. It requires the ENABLE_JAVA flag to be set and Gradle 3.4 or higher. ```cmake if(ENABLE_JAVA) find_package(Gradle 3.4) set(GRADLE_WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/.gradle) set(SYSLOG_DEPS_DIR ${PROJECT_BINARY_DIR}/modules/java) if(GRADLE_FOUND) OPTION(ENABLE_JAVA_MODULES "Enable Java modules" ON) else() OPTION(ENABLE_JAVA_MODULES "Enable Java modules" OFF) endif() set(JAVA_MOD_DST_DIR "${CMAKE_INSTALL_PREFIX}/lib/syslog-ng/java-modules") if(ENABLE_JAVA_MODULES) add_custom_target(BuildJavaModules ALL COMMAND ${GRADLE_EXECUTABLE} --project-cache-dir ${GRADLE_WORKDIR} -g ${GRADLE_WORKDIR} -p ${CMAKE_CURRENT_SOURCE_DIR} -PsyslogBuildDir=${CMAKE_CURRENT_BINARY_DIR} -PsyslogDepsDir=${SYSLOG_DEPS_DIR} build copyJars ) add_dependencies(BuildJavaModules mod-java) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/built-jars/ DESTINATION lib/syslog-ng/java-modules) install(CODE "execute_process(COMMAND ${GRADLE_EXECUTABLE} --project-cache-dir ${GRADLE_WORKDIR} -g ${GRADLE_WORKDIR} -p ${CMAKE_CURRENT_SOURCE_DIR} -PsyslogBuildDir=${CMAKE_CURRENT_BINARY_DIR} -PsyslogDepsDir=${SYSLOG_DEPS_DIR} -PjarDestDir=${JAVA_MOD_DST_DIR} copyLog4j)") set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ".gradle") set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "built-jars") endif() else() OPTION(ENABLE_JAVA_MODULES "Enable Java modules" OFF) endif() ``` -------------------------------- ### Configure Metrics Probe Sources Source: https://github.com/axoflow/axosyslog/blob/main/modules/metrics-probe/CMakeLists.txt Sets the source files for the metrics-probe module. Ensure all listed files are present in the build directory. ```cmake set(METRICS_PROBE_SOURCES metrics-probe.c metrics-probe.h metrics-probe-parser.c metrics-probe-parser.h metrics-probe-plugin.c ) ``` -------------------------------- ### Configure and Build afuser Module Source: https://github.com/axoflow/axosyslog/blob/main/modules/afuser/CMakeLists.txt Defines the module build process, including conditional enabling, source file listing, and test directory registration. ```cmake module_switch(ENABLE_AFUSER "Enable afuser module") if (NOT ENABLE_AFUSER) return() endif() set(AFUSER_SOURCES "afuser-parser.h" "afuser.h" "afuser-plugin.c" "afuser.c" "afuser-parser.c" ) add_module( TARGET afuser GRAMMAR afuser-grammar SOURCES ${AFUSER_SOURCES} ) add_test_subdirectory(tests) ``` -------------------------------- ### Register HTTP Adapters Module Source: https://github.com/axoflow/axosyslog/blob/main/modules/http-adapters/CMakeLists.txt Defines the module target and includes necessary source files and directories. ```cmake add_module( TARGET http-adapters GRAMMAR http-adapters-grammar INCLUDES ${PROJECT_SOURCE_DIR} SOURCES ${HTTP_ADAPTERS_SOURCES} ) ``` -------------------------------- ### Configure MQTT Module with CMake Source: https://github.com/axoflow/axosyslog/blob/main/modules/mqtt/CMakeLists.txt Handles dependency discovery for eclipse-paho-mqtt-c and registers the MQTT module if requirements are met. ```cmake if (NOT DEFINED ENABLE_MQTT OR ENABLE_MQTT) find_package(eclipse-paho-mqtt-c) endif() module_switch(ENABLE_MQTT "Enable mqtt" eclipse-paho-mqtt-c_FOUND) if (ENABLE_MQTT AND NOT eclipse-paho-mqtt-c_FOUND) message (FATAL_ERROR "MQTT enabled but no eclipse-paho-mqtt-c library found") endif () if (NOT ENABLE_MQTT) return() endif() CHECK_STRUCT_HAS_MEMBER("MQTTClient_connectOptions" "httpProxy" "MQTTClient.h" SYSLOG_NG_HAVE_PAHO_HTTP_PROXY) set(MQTT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(MQTT_COMMON mqtt-options.c mqtt-options.h ) add_subdirectory(destination) add_subdirectory(source) set(MQTT_SOURCES mqtt-parser.c mqtt-parser.h mqtt-plugins.c ) add_module( TARGET mqtt GRAMMAR mqtt-grammar DEPENDS mqtt-destination DEPENDS mqtt-source SOURCES ${MQTT_SOURCES} ${MQTT_COMMON} ) ``` -------------------------------- ### Add AxoSyslog nightly repository Source: https://github.com/axoflow/axosyslog/blob/main/README.md Configures the nightly build repository for testing purposes. ```bash tee /etc/yum.repos.d/axosyslog.repo <<< '[axosyslog] name=AxoSyslog baseurl=https://pkg.axoflow.io/rpm/nightly/fedora-$releasever/$basearch enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://pkg.axoflow.io/axoflow-code-signing-pub.asc' > /dev/null ``` -------------------------------- ### Configure Bison grammar generation Source: https://github.com/axoflow/axosyslog/blob/main/modules/examples/sources/threaded-diskq-source/CMakeLists.txt Sets up the Bison target and source file properties for the grammar parser. ```cmake generate_y_from_ym(modules/examples/sources/threaded-diskq-source/threaded-diskq-source-grammar) bison_target(MsgGeneratorGrammar ${CMAKE_CURRENT_BINARY_DIR}/threaded-diskq-source-grammar.y ${CMAKE_CURRENT_BINARY_DIR}/threaded-diskq-source-grammar.c COMPILE_FLAGS ${BISON_FLAGS}) set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/threaded-diskq-source-grammar.c PROPERTIES COMPILE_FLAGS ${BISON_BUILT_SOURCE_CFLAGS} ) ``` -------------------------------- ### Run with Linker-based Syslog Compatibility Source: https://github.com/axoflow/axosyslog/blob/main/lib/eventlog/doc/API.txt Use LD_PRELOAD to intercept syslog calls at runtime without requiring application recompilation. ```bash $ LD_PRELOAD=/usr/lib/libeventlog.so.0 syslogapp ``` -------------------------------- ### External Package Discovery Source: https://github.com/axoflow/axosyslog/blob/main/CMakeLists.txt Locates required external libraries and system components. ```cmake external_or_find_package(IVYKIS REQUIRED) external_or_find_package(JSONC REQUIRED) find_package(OpenSSL REQUIRED) find_package(FLEX REQUIRED) find_package(Resolv REQUIRED) find_package(WRAP) find_package(Inotify) find_package(LIBCAP) find_package(LIBNET) ``` -------------------------------- ### Build AxoSyslog from tarball Source: https://github.com/axoflow/axosyslog/blob/main/dbld/README.md Generate a tarball and perform a manual build process within the build directory. ```bash $ dbld/rules tarball $ Your tarball is in /build, also available on the host in $(top_srcdir)/dbld/build $ cd dbld/build $ tar -xzvf axosyslog*.tar.gz $ ./axosyslog-*/configure $ make ``` -------------------------------- ### Troubleshooting Java Destination Library Path Source: https://github.com/axoflow/axosyslog/blob/main/modules/java/README.md If you encounter errors related to `libjvm.so`, ensure that the `LD_LIBRARY_PATH` environment variable includes the directory containing `libjvm.so`. ```bash Error opening plugin module; module='mod-java', error='libjvm.so: cannot open shared object file: No such file or directory' ``` -------------------------------- ### Build Event Record with AxoSyslog Source: https://github.com/axoflow/axosyslog/blob/main/lib/eventlog/doc/DESIGN.txt Use this sequence of functions to build an event record. The record includes a description, tag/value pairs, and a syslog priority. The evt_log() function consumes the record. ```c evt_rec_init(...) evt_tag_str(...) / evt_tag_int(...) / evt_tag_printf(...) evt_log(...) /* consumes the log record, no need to free it */ ```