<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Syslog-NG Configuration: Review &amp;amp; Advise in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Re-Syslog-NG-Configuration-Review-amp-Advise/m-p/762859#M120775</link>
    <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I want to share with you the Syslog-NG configuration, you can review and advise.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;[+] Syslog-ng Preparation
============================================
Check SELinux status
getenforce

sudo mkdir -p /var/log/syslog
sudo chown -R splunk:splunk /var/log/syslog
sudo chmod 750 /var/log/syslog

sudo tee /etc/sysctl.d/99-syslog-ng.conf &amp;gt; /dev/null &amp;lt;&amp;lt; 'EOF'
# Syslog-ng UDP receive buffer tuning
net.core.rmem_max = 33554432
net.core.rmem_default = 16777216
net.core.netdev_max_backlog = 5000

# TCP keepalive - fast dead-peer detection after keepalived VIP failover
net.ipv4.tcp_keepalive_time = 120
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 5
EOF


sudo sysctl --system
sudo sysctl net.core.rmem_max net.core.rmem_default net.core.netdev_max_backlog net.ipv4.tcp_keepalive_time

============================================
[+] Syslog-NG Configuration
===========================

sudo tee /etc/syslog-ng/conf.d/data_sources.conf &amp;gt; /dev/null &amp;lt;&amp;lt; 'EOF'
###############################################################################
# GLOBAL OPTIONS
###############################################################################

options {
    log-fifo-size(200000);
    threaded(yes);
    use-dns(no);
    dns-cache(no);
	keep-hostname(no);
    chain-hostname(no);
    log-msg-size(65536);
};

###############################################################################
# RAW MESSAGE TEMPLATE
###############################################################################

template t_raw {
    template("$MSG\n");
    template_escape(no);
};

###############################################################################
# TCP SOURCES
###############################################################################
# FortiGate - TCP 1515
source s_fortigate {
    network(
        ip(0.0.0.0)
        transport(tcp)
        port(1515)
        flags(no-parse, flow-control)
        max-connections(100)
        log-iw-size(10000)
        so-keepalive(yes)
        so-rcvbuf(1048576)
    );
};

###############################################################################
# UDP SOURCES
###############################################################################
# F5 WAF - UDP 2514
source s_f5waf {
    network(
        ip(0.0.0.0)
        transport(udp)
        port(2514)
        flags(no-parse)
        so-rcvbuf(4194304)
    );
};

###############################################################################
# TCP DESTINATIONS
###############################################################################
# FortiGate
destination d_fortigate {
    file(
        "/var/log/syslog/fortigate/${SOURCEIP}/${SOURCEIP}-$YEAR-$MONTH-$DAY-$HOUR.log"
        create_dirs(yes)
        dir-owner("splunk")
        dir-group("splunk")
        dir-perm(0750)
        owner("splunk")
        group("splunk")
        perm(0640)
        template(t_raw)
        fsync(no)
    );
};

###############################################################################
# UDP DESTINATIONS
###############################################################################
# F5 WAF
destination d_f5waf {
    file(
        "/var/log/syslog/f5waf/${SOURCEIP}/${SOURCEIP}-$YEAR-$MONTH-$DAY-$HOUR.log"
        create_dirs(yes)
        dir-owner("splunk")
        dir-group("splunk")
        dir-perm(0750)
        owner("splunk")
        group("splunk")
        perm(0640)
        template(t_raw)
        fsync(no)
    );
};

###############################################################################
# LOG PATHS
###############################################################################
log {
    source(s_fortigate);
    destination(d_fortigate);
    flags(final);
};

log {
    source(s_f5waf);
    destination(d_f5waf);
    flags(final);
};
###############################################################################
# END
###############################################################################
EOF

============================================
[+] Validate &amp;amp; Start
============================================
sudo syslog-ng -s
sudo systemctl restart syslog-ng
sudo systemctl status syslog-ng --no-pager

sudo ss -lntup | grep 1514
ss -ulm sport = :2514
============================================
[+] Testing
============================================
loggen --size 500 --rate 1000 --interval 600 10.0.0.1 514

logger --server 127.0.0.1 --port 1514 --tcp "PALOALTO_TCP_TEST"

logger --server 127.0.0.1 --port 2514 --udp "PALOALTO_UDP_TEST"

echo '&amp;lt;134&amp;gt;date=2026-08-11 time=13:00:00 devname=PA01 type=TRAFFIC action=allow srcip=10.1.1.1 dstip=10.2.2.2' | nc -w1 10.0.4.160 1514
============================================&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 12 Aug 2026 10:43:01 GMT</pubDate>
    <dc:creator>0xAli</dc:creator>
    <dc:date>2026-08-12T10:43:01Z</dc:date>
    <item>
      <title>Re: Syslog-NG Configuration: Review &amp; Advise</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Re-Syslog-NG-Configuration-Review-amp-Advise/m-p/762859#M120775</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I want to share with you the Syslog-NG configuration, you can review and advise.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;[+] Syslog-ng Preparation
============================================
Check SELinux status
getenforce

sudo mkdir -p /var/log/syslog
sudo chown -R splunk:splunk /var/log/syslog
sudo chmod 750 /var/log/syslog

sudo tee /etc/sysctl.d/99-syslog-ng.conf &amp;gt; /dev/null &amp;lt;&amp;lt; 'EOF'
# Syslog-ng UDP receive buffer tuning
net.core.rmem_max = 33554432
net.core.rmem_default = 16777216
net.core.netdev_max_backlog = 5000

# TCP keepalive - fast dead-peer detection after keepalived VIP failover
net.ipv4.tcp_keepalive_time = 120
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 5
EOF


sudo sysctl --system
sudo sysctl net.core.rmem_max net.core.rmem_default net.core.netdev_max_backlog net.ipv4.tcp_keepalive_time

============================================
[+] Syslog-NG Configuration
===========================

sudo tee /etc/syslog-ng/conf.d/data_sources.conf &amp;gt; /dev/null &amp;lt;&amp;lt; 'EOF'
###############################################################################
# GLOBAL OPTIONS
###############################################################################

options {
    log-fifo-size(200000);
    threaded(yes);
    use-dns(no);
    dns-cache(no);
	keep-hostname(no);
    chain-hostname(no);
    log-msg-size(65536);
};

###############################################################################
# RAW MESSAGE TEMPLATE
###############################################################################

template t_raw {
    template("$MSG\n");
    template_escape(no);
};

###############################################################################
# TCP SOURCES
###############################################################################
# FortiGate - TCP 1515
source s_fortigate {
    network(
        ip(0.0.0.0)
        transport(tcp)
        port(1515)
        flags(no-parse, flow-control)
        max-connections(100)
        log-iw-size(10000)
        so-keepalive(yes)
        so-rcvbuf(1048576)
    );
};

###############################################################################
# UDP SOURCES
###############################################################################
# F5 WAF - UDP 2514
source s_f5waf {
    network(
        ip(0.0.0.0)
        transport(udp)
        port(2514)
        flags(no-parse)
        so-rcvbuf(4194304)
    );
};

###############################################################################
# TCP DESTINATIONS
###############################################################################
# FortiGate
destination d_fortigate {
    file(
        "/var/log/syslog/fortigate/${SOURCEIP}/${SOURCEIP}-$YEAR-$MONTH-$DAY-$HOUR.log"
        create_dirs(yes)
        dir-owner("splunk")
        dir-group("splunk")
        dir-perm(0750)
        owner("splunk")
        group("splunk")
        perm(0640)
        template(t_raw)
        fsync(no)
    );
};

###############################################################################
# UDP DESTINATIONS
###############################################################################
# F5 WAF
destination d_f5waf {
    file(
        "/var/log/syslog/f5waf/${SOURCEIP}/${SOURCEIP}-$YEAR-$MONTH-$DAY-$HOUR.log"
        create_dirs(yes)
        dir-owner("splunk")
        dir-group("splunk")
        dir-perm(0750)
        owner("splunk")
        group("splunk")
        perm(0640)
        template(t_raw)
        fsync(no)
    );
};

###############################################################################
# LOG PATHS
###############################################################################
log {
    source(s_fortigate);
    destination(d_fortigate);
    flags(final);
};

log {
    source(s_f5waf);
    destination(d_f5waf);
    flags(final);
};
###############################################################################
# END
###############################################################################
EOF

============================================
[+] Validate &amp;amp; Start
============================================
sudo syslog-ng -s
sudo systemctl restart syslog-ng
sudo systemctl status syslog-ng --no-pager

sudo ss -lntup | grep 1514
ss -ulm sport = :2514
============================================
[+] Testing
============================================
loggen --size 500 --rate 1000 --interval 600 10.0.0.1 514

logger --server 127.0.0.1 --port 1514 --tcp "PALOALTO_TCP_TEST"

logger --server 127.0.0.1 --port 2514 --udp "PALOALTO_UDP_TEST"

echo '&amp;lt;134&amp;gt;date=2026-08-11 time=13:00:00 devname=PA01 type=TRAFFIC action=allow srcip=10.1.1.1 dstip=10.2.2.2' | nc -w1 10.0.4.160 1514
============================================&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 12 Aug 2026 10:43:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Re-Syslog-NG-Configuration-Review-amp-Advise/m-p/762859#M120775</guid>
      <dc:creator>0xAli</dc:creator>
      <dc:date>2026-08-12T10:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog-NG Configuration: Review &amp; Advise</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Re-Syslog-NG-Configuration-Review-amp-Advise/m-p/762884#M120777</link>
      <description>&lt;P&gt;Well, this is more of a syslog-ng question than a Splunk one so you might get more info about syslog-ng specific tuning and tweaking on some syslog-ng related mailing list/forum.&lt;/P&gt;&lt;P&gt;But.&lt;/P&gt;&lt;P&gt;I can drop in my three cents (because why not ;-))&lt;/P&gt;&lt;P&gt;1. I'm not (and I've never been) a big fan of the "separate port for everything" approach. Yes, I know that in the old times when we'd receive syslog directly on Splunk forwarder you'd have a separate port for each product so that you can assign different sourcetype to each port. With syslog-ng or rsyslog you can just use network-level metadata (source IP in this case) to assign target source/index/sourcetype to the event. I find this approach more tidy and the network teams like it because you only ever poke holes in firewalls for the typical 514 port instead of doing a wide range of ports.&lt;/P&gt;&lt;P&gt;2. Having said that - I'm not a big expert on syslog-ng and I'm not sure if you can in a reasonably manageable way attach different (post)processing pipelines to a single "source" depending on the event type (so that - for example - events from Palo Alto are processed differently than events from Fortigate while still being received on the same port). With rsyslog it's trivial, I'm not sure about syslog-ng.&lt;/P&gt;&lt;P&gt;3. There are two schools of thought regarding the "middle" between syslog receiver and Splunk. There is the old-school approach which you have in your config - receive events, write them to files, pick them up with monitor input, send to Splunk. There is also the modern-school approach - use http output/connector/whatever you call it to send it from your syslog receiver directly to HEC input.&lt;/P&gt;&lt;P&gt;Both approaches have their pros and cons. The file-based approach requires disk space for the files, requires manual cleaning of the directories but gives you a natural "buffer" if your downstream is not available (your Splunk is down). The HEC output approach is simpler in terms of infrastructure, lets you easily assign additional metadata but is more sensitive to downstream availability (and buffering is more complicated).&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2026 07:47:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Re-Syslog-NG-Configuration-Review-amp-Advise/m-p/762884#M120777</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2026-08-13T07:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog-NG Configuration: Review &amp; Advise</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Re-Syslog-NG-Configuration-Review-amp-Advise/m-p/762886#M120778</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp; it's really appreciated!&lt;BR /&gt;&lt;BR /&gt;I depends on the two the syslog-ng articles:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.splunk.com/en_us/blog/tips-and-tricks/high-performance-syslogging-for-splunk-using-syslog-ng-part-1.html?utm_source=chatgpt.com" target="_self"&gt;https://www.splunk.com/en_us/blog/tips-and-tricks/high-performance-syslogging-for-splunk-using-syslog-ng-part-1.html?utm_source=chatgpt.com&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.splunk.com/en_us/blog/tips-and-tricks/high-performance-syslogging-for-splunk-using-syslog-ng-part-2.html?utm_source=chatgpt.com" target="_self"&gt;https://www.splunk.com/en_us/blog/tips-and-tricks/high-performance-syslogging-for-splunk-using-syslog-ng-part-2.html?utm_source=chatgpt.com&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2026 07:56:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Re-Syslog-NG-Configuration-Review-amp-Advise/m-p/762886#M120778</guid>
      <dc:creator>0xAli</dc:creator>
      <dc:date>2026-08-13T07:56:13Z</dc:date>
    </item>
  </channel>
</rss>

