Hello, here are the system Information I forgot to send.
- nxlog = nxlog-ce-2.11.2190
- rsyslog = rsyslogd 8.2001.0
- graylog = Graylog 4.1.3+9d79c05
So what I now get working so far
nxlog syslog > rsyslog to gelf > Graylog GELF_TCP
But this doesn’t split off the Message.
nxlog.conf
#NoFreeOnExit TRUE
define ROOT C:\Program Files (x86)\nxlog
define CERTDIR %ROOT%\cert
define CONFDIR %ROOT%\conf
define LOGDIR %ROOT%\data
define LOGFILE %LOGDIR%\nxlog.log
LogFile %LOGFILE%
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
######################################################
############## Extensions ############################
<Extension syslog>
Module xm_syslog
</Extension>
########## INPUTS ###########
<Input in>
Module im_msvistalog
</Input>
########################################
<Processor p_anco_01>
Module pm_transformer
Exec $Hostname = hostname();
OutputFormat syslog_rfc5424
</Processor>
################# OUTPUTS ##############
<Output out>
Module om_tcp
Host 192.168.xxx.xx
Port xxxx
Exec $raw_event = replace($raw_event, "\r\n", " ");
Exec $raw_event = replace($raw_event, "\t", " ");
</Output>
#######################################
#################### ROUTE ###########
<Route 1>
Path in => p_anco_01 => out
</Route>
==================================
cat /etc/rsyslog.conf
# /etc/rsyslog.conf configuration file for rsyslog
#
# For more information install rsyslog-doc and see
# /usr/share/doc/rsyslog-doc/html/configuration/index.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#################
#### MODULES ####
#################
#module(load="imuxsock") # provides support for local system logging
#module(load="immark") # provides --MARK-- message capability
# provides UDP syslog reception
#module(load="imudp")
#input(type="imudp" port="514")
# provides TCP syslog reception
module(load="imtcp")
input(type="imtcp" port="xxxx")
# Erlaubte Sender Definieren
$AllowedSender TCP, 192.168.0.0/16
# Speicherort Syslogmeldungen
$template RemoteLogs, "/var/log/%FROMHOST-IP%/syslog_tcp05.log"
*.* ?RemoteLogs
# Gelf Template
# https://www.rsyslog.com/doc/master/tutorials/gelf_forwarding.html
template(name="gelf" type="list") {
constant(value="{\"version\":\"1.1\",")
constant(value="\"host\":\"")
property(name="hostname")
constant(value="\",\"short_message\":\"")
property(name="msg" format="json")
constant(value="\",\"timestamp\":")
property(name="timegenerated" dateformat="unixtimestamp")
constant(value=",\"level\":\"")
property(name="syslogseverity")
constant(value="\"}")
}
action(type="omfwd" Target="192.168.xxx.xx" port="xxxx" Protocol="tcp" template="gelf" TCP_FrameDelimiter="0")
###########################
#### GLOBAL DIRECTIVES ####
###########################
#
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
# Filter duplicated messages
$RepeatedMsgReduction on
#
# Set the default permissions for all log files.
#
$FileOwner syslog
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$PrivDropToUser syslog
$PrivDropToGroup syslog
#
# Where to place spool and state files
#
$WorkDirectory /var/spool/rsyslog
#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
==========================================================
What I want to do, is sent nxlog gelf to Rsyslog and forward it to Graylog so that the automatic parsing could happen.
nxlog.conf
#NoFreeOnExit TRUE
define ROOT C:\Program Files (x86)\nxlog
define CERTDIR %ROOT%\cert
define CONFDIR %ROOT%\conf
define LOGDIR %ROOT%\data
define LOGFILE %LOGDIR%\nxlog.log
LogFile %LOGFILE%
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
######################################################
############## Extensions ############################
<Extension _gelf>
Module xm_gelf
</Extension>
########## INPUTS ###########
<Input in>
Module im_msvistalog
</Input>
########################################
################# OUTPUTS ##############
<Output out>
Module om_tcp
Host 192.168.xxx.xxx
Port xxxxx
OutputType GELF_TCP
</Output>
#######################################
#################### ROUTE ###########
<Route 1>
Path in => out
</Route>
=====================================================
rsyslog.conf
root@vsd-nc-dev:/etc# cat rsyslog.conf_sic2021_09_03
# /etc/rsyslog.conf configuration file for rsyslog
#
# For more information install rsyslog-doc and see
# /usr/share/doc/rsyslog-doc/html/configuration/index.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#################
#### MODULES ####
#################
#module(load="imuxsock") # provides support for local system logging
#module(load="immark") # provides --MARK-- message capability
# provides UDP syslog reception
#module(load="imudp")
#input(type="imudp" port="514")
# provides TCP syslog reception
module(load="imtcp")
input(type="imtcp" port="xxxx")
# Erlaubte Sender Definieren
$AllowedSender TCP, 192.168.0.0/16
# Speicherort Syslogmeldungen
$template RemoteLogs, "/var/log/%FROMHOST-IP%/gelf_tcp03.log"
*.* ?RemoteLogs
template(name="foobar" type="string" string="%syslogtag%%msg%") action(type="omfwd" Target="192.168.xxx.xxx" port="xxxx" Protocol="tcp" template="foobar" TCP_FrameDelimiter="0")
###########################
#### GLOBAL DIRECTIVES ####
###########################
#
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
# Filter duplicated messages
$RepeatedMsgReduction on
#
# Set the default permissions for all log files.
#
$FileOwner syslog
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$PrivDropToUser syslog
$PrivDropToGroup syslog
#
# Where to place spool and state files
#
$WorkDirectory /var/spool/rsyslog
#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
===================================================
Working so far.
- NXLog messages are stored on the Rsyslog Server
- Only the first Message is shown in Graylog not the following
My though are it’s the Delimiter that is used in the rsyslog stream to Graylog.
If I watch the stream with tcpdump it shows
on the working stream to graylog
on the not working stream to Graylog