Configure a syslog-ng server
To configure a syslog-ng server, complete the following steps:
- Save a copy of
syslog-ng.conf
before editing it. - Open
syslog-ng.conf
, and edit it to make configuration changes. The followingsyslog-ng.conf
file shows an example of how incoming events can be separated using regex filters. Each unique data source type has a directory created under/home/syslog/logs
. Set thecreate_dirs
attribute toyes
to create the necessary directories, if they don't already exist.# syslog-ng configuration file. # # options { chain_hostnames(no); create_dirs (yes); dir_perm(0755); dns_cache(yes); keep_hostname(yes); log_fifo_size(2048); log_msg_size(8192); perm(0644); time_reopen (10); use_dns(yes); use_fqdn(yes); }; source s_network { udp(port(514)); }; #Destinations destination d_cisco_asa { file(“/home/syslog/logs/cisco/asa/$HOST/$YEAR-$MONTH-$DAY-cisco-asa.log” create_dirs(yes)); }; # Filters filter f_cisco_asa { match(“%ASA” value(“PROGRAM”)) or match(“%ASA” value(“MESSAGE”)); }; filter f_all { not ( filter(f_cisco_asa) ); }; # Log log { source(s_network); filter(f_cisco_asa); destination(d_cisco_asa); }; log { source(s_network); filter(f_all); destination(d_all); };
- Restart
syslog-ng
to apply updates.
sudo systemctl restart syslog-ng.service
For more information refer to the syslog-ng
installation manual at OneIdentity.com.
Install a syslog-ng server | Install a universal forwarder on the same host as the syslog-ng server |
This documentation applies to the following versions of Splunk® Enterprise: 7.2.0, 7.2.1, 7.2.2, 7.2.3, 7.2.4, 7.2.5, 7.2.6, 7.2.7, 7.2.8, 7.2.9, 7.2.10, 7.3.0, 7.3.1, 7.3.2, 7.3.3, 7.3.4, 7.3.5, 7.3.6, 7.3.7, 7.3.8, 7.3.9, 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.5, 8.0.6, 8.0.7, 8.0.8, 8.0.9, 8.0.10
Feedback submitted, thanks!