<?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 fundamentals in Training + Certification Discussions</title>
    <link>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712808#M2137</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/269906"&gt;@ayomotukoya&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Syslog-ng, an open-source Linux utility, is one of the most preferred and easy ways to listen and write logs from a variety of network and security devices and write them to a human-readable format in text files. Once you have setup your syslog-ng system in place, it becomes piece of cake to ingest those logs into Splunk by using a small-weight universal forwarder deployed on the syslog-server. In this post, we will walk you through the steps, best practices, and sample configuration file for syslog-ng and Splunk Universal forwarder inputs.conf.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note: Please note the steps and suggestions are mentioned for nix* OS only.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Install Syslog-ng&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Install the Syslog-ng utility in case it’s not already present on OS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Check if syslog-ng service is present/running on the system:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;systemctl status syslog-ng&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;If the command gives an error that no such service is present, install the service by using one of the below commands, depending on the type of nix* OS you are using:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;yum install syslog-ng&lt;/I&gt;&lt;I&gt;&lt;BR /&gt;&lt;/I&gt;&lt;I&gt;apt-get install syslog-ng&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;This will download and install the syslog-ng service on the Linux OS. By default, now if you will run the systemctl status command, it should show the status of the service as running.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Configure Custom Syslog Ports on each Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For collecting data from multiple Syslog devices and subsequently ingesting it into Splunk, it’s easy if you configure each device to send logs a unique port to your Syslog server instead of the default port 514. For example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Palo Alto Firewall &amp;gt; Syslog_Server:5515/TCP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Fortinet Firewall &amp;gt; Syslong_Server:5516/TCP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CISCO Router &amp;gt; Sysog_Server:5517/TCP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This approach has multiple advantages:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Simplicity of configuration required on Syslog-ng: Syslog-ng can be configured to listen to multiple ports. As each port is unique to a device type, further configurations make it simpler to write all the logs listened to from that port to a directory specific to each device.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Ease of Troubleshooting: As each device is sending on a unique port, it makes the network troubleshooting also easier in case Syslog is not receiving logs from a particular device. You can easily do a tcpdump on the syslog server for that port and see if there’s any traffic hitting at all or not.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;tcpdump -i &amp;lt;interface&amp;gt; | grep &amp;lt;portnumber&amp;gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Syslog-ng File Configuration and Troubleshooting&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Following is the default location for relevant Syslog-NG configuration files:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;SPAN&gt;/etc/syslog-ng/syslog-ng.conf&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt; – This is the master config file which ships along with syslog-ng installation&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;SPAN&gt;/etc/syslog-ng/conf.d&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt; – Any .conf file created under this directory is processed along with syslog-ng.conf file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As a best practice we create our custom configuration file under the conf.d directory as it’s a more modular approach and allows creating multiple files for different configuration without effecting the overall functionality.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Following is a sample configuration file created under conf.d directory:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;SPAN&gt;syslog_custom_ports.conf&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#Listen on port 5515/tcp for logs being sent by Palo Alto Firewall and write it to corresponding folder having date as filename&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;source palo_alto {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;tcp(ip(0.0.0.0) port(5515));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;destination d_palo_alto {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;file(“/opt/syslog-ng/palo_alto/$HOST/$MONTH$DAY.log”);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;log &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;source(palo_alto);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;destination(d_palo_alto);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#Listen on port 5516/tcp for logs being sent by Fortinet firewall and write it to corresponding folder having date as filename&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;source fortinet {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;tcp(ip(0.0.0.0) port(5516));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;destination d_fortinet&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;file(“/opt/syslog-ng/fortinet/$HOST/$MONTH$DAY.log”);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;log &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;source(fortinet);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;destination(d_fortinet);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#Listen on port 5517/tcp for logs being sent by Cisco router and write it to corresponding folder having date as filename&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;source cisco_router {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;tcp(ip(0.0.0.0) port(5517));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;destination d_cisco_router&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;file(“/opt/syslog-ng/cisco_router/$HOST/$MONTH$DAY.log”);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;log &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;source(cisco_router);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;destination(d_cisco_router);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Once you save the file you need to reload the syslog-ng service for the new changes to take effect:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;#&lt;/I&gt;&lt;/STRONG&gt;&lt;STRONG&gt; Reloading configuration file without restarting syslog-ng&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;systemctl reload syslog-ng&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;#Restarting syslog-ng&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;systemctl restart syslog-ng&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;If the configuration file is correct and there are no permissions service should reload correctly post which you can run the following commands to see which all ports are now active on the OS where syslog-ng is listening on&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;netstat -an&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;I&gt;Also, if you have devices sending logs in, navigate to respective directory and verify the logs are being written correcty.&lt;/I&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;vi &lt;/I&gt;&lt;I&gt;/opt/syslog-ng/PaloAlto/&amp;lt;host&amp;gt;/&amp;lt;date in ddmm format&amp;gt;.log&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;In case there is any issue with syntax of the file run following command to see the errors:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;syslog-ng –syntax-only&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;For other issues further troubleshooting might be required, often analyzing the logs in/var/log/messages is found to be quite helpful. Also, at times SELinux might be causing issues in which case try disabling the SELinux on the OS level.&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;vi /etc/selinux/config&lt;/I&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;I&gt;SELINUX=disabled&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;STRONG&gt;# reboot OS for changes to take effect&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;I&gt;restart&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;Read the logs by Splunk&lt;/P&gt;&lt;P&gt;Depending whether you are managing the configurations through Splunk Deployment server or managing them locally on the instance you need to place inputs.conf file on the syslog-server running Universal Forwarder or Heavy Forwarder. In the inputs.conf you need to define the monitor stanzas for each device/log source you configured in the Syslog-ng. For the above syslog-ng following is a sample inputs.conf file:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;[monitor:///opt/syslog-ng/palo_alto/*/*.log]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;host_segment = 4&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;index = palo_alto&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;#sourcetype as per add-on installed or custom sourcetype defined&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;sourcetype = pan:firewall&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;no_appending_timestamp = true&lt;/STRONG&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2025 12:11:37 GMT</pubDate>
    <dc:creator>kiran_panchavat</dc:creator>
    <dc:date>2025-02-28T12:11:37Z</dc:date>
    <item>
      <title>Syslog fundamentals</title>
      <link>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712727#M2127</link>
      <description>&lt;P&gt;I want to trouble shoot an issue with our syslog servers logs being sent to the last chance index but im realizing I dont understand the syntax for the configuration of the conf files on the syslog servers to do so. Where can I gain fundamental knowledge of syslog ng and how to configure it to send logs into splunk?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 18:42:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712727#M2127</guid>
      <dc:creator>ayomotukoya</dc:creator>
      <dc:date>2025-02-27T18:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog fundamentals</title>
      <link>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712737#M2128</link>
      <description>&lt;P&gt;Which Syslog system are you using? There are likely docs available online for it.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 20:23:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712737#M2128</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2025-02-27T20:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog fundamentals</title>
      <link>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712739#M2129</link>
      <description>&lt;P&gt;Syslog ng&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 20:25:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712739#M2129</guid>
      <dc:creator>ayomotukoya</dc:creator>
      <dc:date>2025-02-27T20:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog fundamentals</title>
      <link>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712747#M2130</link>
      <description>&lt;P&gt;You could give&amp;nbsp;&lt;A href="https://syslog-ng.github.io/admin-guide/050_The_configuration_file/001_Configuration_syntax.html" target="_blank"&gt;https://syslog-ng.github.io/admin-guide/050_The_configuration_file/001_Configuration_syntax.html&lt;/A&gt;&amp;nbsp;a shot, for understanding how the configuration file syntax works.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 20:58:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712747#M2130</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2025-02-27T20:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog fundamentals</title>
      <link>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712807#M2136</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/269906"&gt;@ayomotukoya&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please check this documentation for syslog-ng&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.splunk.com/en_us/blog/tips-and-tricks/using-syslog-ng-with-splunk.html" target="_blank"&gt;Using Syslog-ng with Splunk | Splunk&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.syslog-ng.com/community/b/blog/posts/sending-logs-to-splunk-using-syslog-ng" target="_blank"&gt;Sending logs to Splunk using syslog-ng - Blog - syslog-ng Community - syslog-ng Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.oneidentity.com/technical-documents/syslog-ng-premium-edition/7.0.34/administration-guide/20" target="_blank"&gt;syslog-ng Premium Edition 7.0.34 - Administration Guide&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.syslog-ng.com/community/b/blog/posts/syslog-ng-101-part-4-configuration-and-testing" target="_blank"&gt;Syslog-ng 101, part 4: Configuration and testing - Blog - syslog-ng Community - syslog-ng Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 12:04:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712807#M2136</guid>
      <dc:creator>kiran_panchavat</dc:creator>
      <dc:date>2025-02-28T12:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog fundamentals</title>
      <link>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712808#M2137</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/269906"&gt;@ayomotukoya&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Syslog-ng, an open-source Linux utility, is one of the most preferred and easy ways to listen and write logs from a variety of network and security devices and write them to a human-readable format in text files. Once you have setup your syslog-ng system in place, it becomes piece of cake to ingest those logs into Splunk by using a small-weight universal forwarder deployed on the syslog-server. In this post, we will walk you through the steps, best practices, and sample configuration file for syslog-ng and Splunk Universal forwarder inputs.conf.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note: Please note the steps and suggestions are mentioned for nix* OS only.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Install Syslog-ng&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Install the Syslog-ng utility in case it’s not already present on OS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Check if syslog-ng service is present/running on the system:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;systemctl status syslog-ng&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;If the command gives an error that no such service is present, install the service by using one of the below commands, depending on the type of nix* OS you are using:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;yum install syslog-ng&lt;/I&gt;&lt;I&gt;&lt;BR /&gt;&lt;/I&gt;&lt;I&gt;apt-get install syslog-ng&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;This will download and install the syslog-ng service on the Linux OS. By default, now if you will run the systemctl status command, it should show the status of the service as running.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Configure Custom Syslog Ports on each Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For collecting data from multiple Syslog devices and subsequently ingesting it into Splunk, it’s easy if you configure each device to send logs a unique port to your Syslog server instead of the default port 514. For example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Palo Alto Firewall &amp;gt; Syslog_Server:5515/TCP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Fortinet Firewall &amp;gt; Syslong_Server:5516/TCP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CISCO Router &amp;gt; Sysog_Server:5517/TCP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This approach has multiple advantages:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Simplicity of configuration required on Syslog-ng: Syslog-ng can be configured to listen to multiple ports. As each port is unique to a device type, further configurations make it simpler to write all the logs listened to from that port to a directory specific to each device.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Ease of Troubleshooting: As each device is sending on a unique port, it makes the network troubleshooting also easier in case Syslog is not receiving logs from a particular device. You can easily do a tcpdump on the syslog server for that port and see if there’s any traffic hitting at all or not.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;tcpdump -i &amp;lt;interface&amp;gt; | grep &amp;lt;portnumber&amp;gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Syslog-ng File Configuration and Troubleshooting&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Following is the default location for relevant Syslog-NG configuration files:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;SPAN&gt;/etc/syslog-ng/syslog-ng.conf&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt; – This is the master config file which ships along with syslog-ng installation&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;SPAN&gt;/etc/syslog-ng/conf.d&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt; – Any .conf file created under this directory is processed along with syslog-ng.conf file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As a best practice we create our custom configuration file under the conf.d directory as it’s a more modular approach and allows creating multiple files for different configuration without effecting the overall functionality.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Following is a sample configuration file created under conf.d directory:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;SPAN&gt;syslog_custom_ports.conf&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#Listen on port 5515/tcp for logs being sent by Palo Alto Firewall and write it to corresponding folder having date as filename&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;source palo_alto {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;tcp(ip(0.0.0.0) port(5515));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;destination d_palo_alto {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;file(“/opt/syslog-ng/palo_alto/$HOST/$MONTH$DAY.log”);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;log &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;source(palo_alto);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;destination(d_palo_alto);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#Listen on port 5516/tcp for logs being sent by Fortinet firewall and write it to corresponding folder having date as filename&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;source fortinet {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;tcp(ip(0.0.0.0) port(5516));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;destination d_fortinet&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;file(“/opt/syslog-ng/fortinet/$HOST/$MONTH$DAY.log”);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;log &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;source(fortinet);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;destination(d_fortinet);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#Listen on port 5517/tcp for logs being sent by Cisco router and write it to corresponding folder having date as filename&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;source cisco_router {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;tcp(ip(0.0.0.0) port(5517));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;destination d_cisco_router&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;file(“/opt/syslog-ng/cisco_router/$HOST/$MONTH$DAY.log”);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;log &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;source(cisco_router);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;destination(d_cisco_router);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Once you save the file you need to reload the syslog-ng service for the new changes to take effect:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;#&lt;/I&gt;&lt;/STRONG&gt;&lt;STRONG&gt; Reloading configuration file without restarting syslog-ng&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;systemctl reload syslog-ng&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;#Restarting syslog-ng&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;systemctl restart syslog-ng&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;If the configuration file is correct and there are no permissions service should reload correctly post which you can run the following commands to see which all ports are now active on the OS where syslog-ng is listening on&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;netstat -an&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;I&gt;Also, if you have devices sending logs in, navigate to respective directory and verify the logs are being written correcty.&lt;/I&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;vi &lt;/I&gt;&lt;I&gt;/opt/syslog-ng/PaloAlto/&amp;lt;host&amp;gt;/&amp;lt;date in ddmm format&amp;gt;.log&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;In case there is any issue with syntax of the file run following command to see the errors:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;syslog-ng –syntax-only&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;For other issues further troubleshooting might be required, often analyzing the logs in/var/log/messages is found to be quite helpful. Also, at times SELinux might be causing issues in which case try disabling the SELinux on the OS level.&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;I&gt;vi /etc/selinux/config&lt;/I&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;I&gt;SELINUX=disabled&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;STRONG&gt;# reboot OS for changes to take effect&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;I&gt;restart&lt;/I&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;Read the logs by Splunk&lt;/P&gt;&lt;P&gt;Depending whether you are managing the configurations through Splunk Deployment server or managing them locally on the instance you need to place inputs.conf file on the syslog-server running Universal Forwarder or Heavy Forwarder. In the inputs.conf you need to define the monitor stanzas for each device/log source you configured in the Syslog-ng. For the above syslog-ng following is a sample inputs.conf file:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;[monitor:///opt/syslog-ng/palo_alto/*/*.log]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;host_segment = 4&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;index = palo_alto&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;#sourcetype as per add-on installed or custom sourcetype defined&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;sourcetype = pan:firewall&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;no_appending_timestamp = true&lt;/STRONG&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 12:11:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/Syslog-fundamentals/m-p/712808#M2137</guid>
      <dc:creator>kiran_panchavat</dc:creator>
      <dc:date>2025-02-28T12:11:37Z</dc:date>
    </item>
  </channel>
</rss>

