Syslog configure to collect logs from nodes like Cisco, Huawei Switch Router

Featured Image
Hasan-Uz-Zaman Ashik

Written by Hasan-Uz-Zaman

January 2, 2021

h

Table of Contents

$
Setup Syslog-ng in the server
$
Configure Syslog-ng to accept logs from sources
$
Configure remote nodes to send logs to the Ubuntu server
$
Configure destinations to store logs
$
Develop web tool/ install database client tool/ data analysis tool to visualize logs

After installing Syslog in the server, we can configure it to receive log from UDP or TCP port and perform some filtering before sending it to our destination (pgsql database).

Versions used in this article:

Syslog-ng: 3.30

PostgreSQL: 9.5

Server: ubuntu 16.04

Default config directory of syslog-ng in ubuntu server is:

/etc/syslog-ng/syslog-ng.conf

@version: 3.30

@include “scl.conf”

 

The first line specifies the version of Syslog-ng. The following line is Source Configuration Library (SCL) that generates a reusable configuration file, which can be used to implement existing templates. [More about SCL]

 

Now, lets define some global parameters.

We have defined use-uniqid to get a unique id for each log message. The id is a non-zero 48-bit integer number, and the value starts again from 1 when it exceeds the max value limit.

Sources driver from which syslog-ng will collect log.

Destination location where log messages will be stored/processed:

Destination 1 stores logs in .text format in respective directories. Moreover, destination two stores log to the PostgreSQL database. We need to install pgsql and create a database there before sending logs.

Finally, the log statement combines multiple sources and destinations.

 

Visualizing pgsql database stored log in DBeaver: 

See log in DBeaver SQL client application

Web-tool to visualize log from PostgreSQL database with search feature:

visualise log in webpage with search feature

A web app that has been developed to visualize syslog logs stored in a PostgreSQL database. This app provides users with IP, log message, and time range-based search features that make it easy to identify trends and patterns in log data.

The web app, called “PostgreSQL Syslog Viewer,” is a powerful tool for anyone who needs to analyze syslog logs stored in a PostgreSQL database. With its intuitive interface, users can quickly and easily navigate through log files and search for specific data points.

One of the key features of the PostgreSQL Syslog Viewer is its IP search functionality. This allows users to search for specific IP addresses within log files. This is especially useful when looking for specific events or errors that may have occurred on a particular system or network. The search function is lightning-fast and can quickly locate specific entries in even the largest log files.

Another powerful feature of the PostgreSQL Syslog Viewer is its log message search functionality. Users can search for specific text within log files. This is especially useful when looking for specific events or errors that may have occurred within the syslog logs. The search function is intuitive and user-friendly, making it easy for even novice users to find the information they need.

Finally, the PostgreSQL Syslog Viewer includes a time range-based search feature. This allows users to search for specific log entries within a specific time range. This is especially useful when looking for events or errors that may have occurred during a particular time period.

In addition to its search features, the PostgreSQL Syslog Viewer also includes several visualization options. Users can view logs in a variety of different formats, including tables, graphs, and charts. This allows users to quickly identify trends and patterns within the data.

You May Also Like…

Hasan-Uz-Zaman

Hasan-Uz-Zaman

Network Engineer

Zaman is an aspiring Technical Writer and passionate about software-defined networking (SDN), Network Automation, Ansible, Log data management (Syslog-ng), Python tools, Web Application development (django) etc.

Let's start talking!

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *