[syslog-ng] Verifying local logs and remote logs are being sent to destination graylog

Rodney Bizzell hardworker30 at gmail.com
Wed Nov 7 18:39:57 UTC 2018


Hello,
So I have made the change to my config and sent test messages which will be
sent to /var/log/messages but I haven't seen anything in my graylog host. I
have done netcat and telnet to make sure the syslog-ng server can connect
to graylog server using 12201.  I have used syslog-ng -Fevd to see what is
happening and it says loading config from syslog-ng and connection
established.

# syslog-ng -Fevd

Starting to read include file; filename='/etc/syslog-ng/scl.conf', depth='1'

Global value changed; define='scl-root',
value='/usr/share/syslog-ng/include/scl'

Global value changed; define='include-path',
value='/etc/syslog-ng:/usr/share/syslog-ng/include'

Starting to read include file;
filename='/usr/share/syslog-ng/include/scl/system/plugin.conf', depth='2'

Module loaded and initialized successfully; module='system-source'

Finishing include;
filename='/usr/share/syslog-ng/include/scl/system/plugin.conf', depth='2'

Starting to read include file;
filename='/usr/share/syslog-ng/include/scl/pacct/plugin.conf', depth='2'

Reading path for candidate modules; path='//usr/lib64/syslog-ng'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='affile.so', module='affile'

Registering candidate plugin; module='affile', context='source',
name='file', preference='0'

Registering candidate plugin; module='affile', context='source',
name='pipe', preference='0'

Registering candidate plugin; module='affile', context='destination',
name='file', preference='0'

Registering candidate plugin; module='affile', context='destination',
name='pipe', preference='0'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='afprog.so', module='afprog'

Registering candidate plugin; module='afprog', context='source',
name='program', preference='0'

Registering candidate plugin; module='afprog', context='destination',
name='program', preference='0'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='afsocket-notls.so', module='afsocket-notls'

Registering candidate plugin; module='afsocket-notls', context='source',
name='unix-stream', preference='0'

Registering candidate plugin; module='afsocket-notls',
context='destination', name='unix-stream', preference='0'

Registering candidate plugin; module='afsocket-notls', context='source',
name='unix-dgram', preference='0'

Registering candidate plugin; module='afsocket-notls',
context='destination', name='unix-dgram', preference='0'

Registering candidate plugin; module='afsocket-notls', context='source',
name='tcp', preference='0'

Registering candidate plugin; module='afsocket-notls',
context='destination', name='tcp', preference='0'

Registering candidate plugin; module='afsocket-notls', context='source',
name='tcp6', preference='0'

Registering candidate plugin; module='afsocket-notls',
context='destination', name='tcp6', preference='0'

Registering candidate plugin; module='afsocket-notls', context='source',
name='udp', preference='0'

Registering candidate plugin; module='afsocket-notls',
context='destination', name='udp', preference='0'

Registering candidate plugin; module='afsocket-notls', context='source',
name='udp6', preference='0'

Registering candidate plugin; module='afsocket-notls',
context='destination', name='udp6', preference='0'

Registering candidate plugin; module='afsocket-notls', context='source',
name='syslog', preference='0'

Registering candidate plugin; module='afsocket-notls',
context='destination', name='syslog', preference='0'

Registering candidate plugin; module='afsocket-notls', context='source',
name='network', preference='0'

Registering candidate plugin; module='afsocket-notls',
context='destination', name='network', preference='0'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='afsocket-tls.so', module='afsocket-tls'

Registering candidate plugin; module='afsocket-tls', context='source',
name='unix-stream', preference='100'

Registering candidate plugin; module='afsocket-tls', context='destination',
name='unix-stream', preference='100'

Registering candidate plugin; module='afsocket-tls', context='source',
name='unix-dgram', preference='100'

Registering candidate plugin; module='afsocket-tls', context='destination',
name='unix-dgram', preference='100'

Registering candidate plugin; module='afsocket-tls', context='source',
name='tcp', preference='100'

Registering candidate plugin; module='afsocket-tls', context='destination',
name='tcp', preference='100'

Registering candidate plugin; module='afsocket-tls', context='source',
name='tcp6', preference='100'

Registering candidate plugin; module='afsocket-tls', context='destination',
name='tcp6', preference='100'

Registering candidate plugin; module='afsocket-tls', context='source',
name='udp', preference='100'

Registering candidate plugin; module='afsocket-tls', context='destination',
name='udp', preference='100'

Registering candidate plugin; module='afsocket-tls', context='source',
name='udp6', preference='100'

Registering candidate plugin; module='afsocket-tls', context='destination',
name='udp6', preference='100'

Registering candidate plugin; module='afsocket-tls', context='source',
name='syslog', preference='100'

Registering candidate plugin; module='afsocket-tls', context='destination',
name='syslog', preference='100'

Registering candidate plugin; module='afsocket-tls', context='source',
name='network', preference='100'

Registering candidate plugin; module='afsocket-tls', context='destination',
name='network', preference='100'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='afsocket.so', module='afsocket'

Registering candidate plugin; module='afsocket', context='source',
name='unix-stream', preference='100'

Registering candidate plugin; module='afsocket', context='destination',
name='unix-stream', preference='100'

Registering candidate plugin; module='afsocket', context='source',
name='unix-dgram', preference='100'

Registering candidate plugin; module='afsocket', context='destination',
name='unix-dgram', preference='100'

Registering candidate plugin; module='afsocket', context='source',
name='tcp', preference='100'

Registering candidate plugin; module='afsocket', context='destination',
name='tcp', preference='100'

Registering candidate plugin; module='afsocket', context='source',
name='tcp6', preference='100'

Registering candidate plugin; module='afsocket', context='destination',
name='tcp6', preference='100'

Registering candidate plugin; module='afsocket', context='source',
name='udp', preference='100'

Registering candidate plugin; module='afsocket', context='destination',
name='udp', preference='100'

Registering candidate plugin; module='afsocket', context='source',
name='udp6', preference='100'

Registering candidate plugin; module='afsocket', context='destination',
name='udp6', preference='100'

Registering candidate plugin; module='afsocket', context='source',
name='syslog', preference='100'

Registering candidate plugin; module='afsocket', context='destination',
name='syslog', preference='100'

Registering candidate plugin; module='afsocket', context='source',
name='network', preference='100'

Registering candidate plugin; module='afsocket', context='destination',
name='network', preference='100'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='afstomp.so', module='afstomp'

Registering candidate plugin; module='afstomp', context='destination',
name='stomp', preference='0'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='afuser.so', module='afuser'

Registering candidate plugin; module='afuser', context='destination',
name='usertty', preference='0'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='basicfuncs.so', module='basicfuncs'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='grep', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='if', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='echo', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='length', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='substr', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='strip', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='sanitize', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='lowercase', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='uppercase', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='replace-delimiter', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='+', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='-', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='*', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='/', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='%', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='ipv4-to-int', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='indent-multi-line', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='context-length', preference='0'

Registering candidate plugin; module='basicfuncs', context='template-func',
name='env', preference='0'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='confgen.so', module='confgen'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='cryptofuncs.so', module='cryptofuncs'

Registering candidate plugin; module='cryptofuncs',
context='template-func', name='uuid', preference='0'

Registering candidate plugin; module='cryptofuncs',
context='template-func', name='hash', preference='0'

Registering candidate plugin; module='cryptofuncs',
context='template-func', name='sha1', preference='0'

Registering candidate plugin; module='cryptofuncs',
context='template-func', name='sha256', preference='0'

Registering candidate plugin; module='cryptofuncs',
context='template-func', name='sha512', preference='0'

Registering candidate plugin; module='cryptofuncs',
context='template-func', name='md4', preference='0'

Registering candidate plugin; module='cryptofuncs',
context='template-func', name='md5', preference='0'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='csvparser.so', module='csvparser'

Registering candidate plugin; module='csvparser', context='parser',
name='csv-parser', preference='0'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='dbparser.so', module='dbparser'

Registering candidate plugin; module='dbparser', context='parser',
name='db-parser', preference='0'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='linux-kmsg-format.so', module='linux-kmsg-format'

Registering candidate plugin; module='linux-kmsg-format', context='format',
name='linux-kmsg', preference='0'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='syslogformat.so', module='syslogformat'

Registering candidate plugin; module='syslogformat', context='format',
name='syslog', preference='0'

Registering candidate plugin; module='syslogformat', context='parser',
name='syslog-parser', preference='0'

Reading shared object for a candidate module; path='//usr/lib64/syslog-ng',
fname='system-source.so', module='system-source'

Finishing include;
filename='/usr/share/syslog-ng/include/scl/pacct/plugin.conf', depth='2'

Starting to read include file;
filename='/usr/share/syslog-ng/include/scl/syslogconf/plugin.conf',
depth='2'

Module loaded and initialized successfully; module='confgen'

Finishing include;
filename='/usr/share/syslog-ng/include/scl/syslogconf/plugin.conf',
depth='2'

Finishing include; filename='/etc/syslog-ng/scl.conf', depth='1'

Module loaded and initialized successfully; module='afsocket-tls'

Module loaded and initialized successfully; module='affile'

Finishing include; content='source confgen system', depth='1'

Module loaded and initialized successfully; module='afuser'

Compiling #unnamed sequence [log] at [/etc/syslog-ng/syslog-ng.conf:6]

  Compiling s_sys reference [source] at [/etc/syslog-ng/syslog-ng.conf:6]

    Compiling s_sys sequence [source] at [/etc/syslog-ng/syslog-ng.conf:2]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:2]

        Compiling #unnamed single [log] at [#buffer:1:1]

        Compiling #unnamed single [log] at [#buffer:2:1]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:2]

  Compiling f_kernel reference [filter] at [/etc/syslog-ng/syslog-ng.conf:6]

    Compiling f_kernel sequence [filter] at
[/etc/syslog-ng/syslog-ng.conf:5]

      Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:5]

  Compiling d_cons reference [destination] at
[/etc/syslog-ng/syslog-ng.conf:6]

    Compiling d_cons sequence [destination] at
[/etc/syslog-ng/syslog-ng.conf:3]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:3]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:3]

Compiling #unnamed sequence [log] at [/etc/syslog-ng/syslog-ng.conf:6]

  Compiling s_sys reference [source] at [/etc/syslog-ng/syslog-ng.conf:6]

  Compiling f_kernel reference [filter] at [/etc/syslog-ng/syslog-ng.conf:6]

    Compiling f_kernel sequence [filter] at
[/etc/syslog-ng/syslog-ng.conf:5]

      Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:5]

  Compiling d_kern reference [destination] at
[/etc/syslog-ng/syslog-ng.conf:6]

    Compiling d_kern sequence [destination] at
[/etc/syslog-ng/syslog-ng.conf:4]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:4]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:4]

Compiling #unnamed sequence [log] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling s_sys reference [source] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling f_default reference [filter] at
[/etc/syslog-ng/syslog-ng.conf:7]

    Compiling f_default sequence [filter] at
[/etc/syslog-ng/syslog-ng.conf:5]

      Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:5]

  Compiling d_mesg reference [destination] at
[/etc/syslog-ng/syslog-ng.conf:7]

    Compiling d_mesg sequence [destination] at
[/etc/syslog-ng/syslog-ng.conf:3]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:3]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:3]

Compiling #unnamed sequence [log] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling s_sys reference [source] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling f_auth reference [filter] at [/etc/syslog-ng/syslog-ng.conf:7]

    Compiling f_auth sequence [filter] at [/etc/syslog-ng/syslog-ng.conf:5]

      Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:5]

  Compiling d_auth reference [destination] at
[/etc/syslog-ng/syslog-ng.conf:7]

    Compiling d_auth sequence [destination] at
[/etc/syslog-ng/syslog-ng.conf:3]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:3]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:3]

Compiling #unnamed sequence [log] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling s_sys reference [source] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling f_mail reference [filter] at [/etc/syslog-ng/syslog-ng.conf:7]

    Compiling f_mail sequence [filter] at [/etc/syslog-ng/syslog-ng.conf:6]

      Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:6]

  Compiling d_mail reference [destination] at
[/etc/syslog-ng/syslog-ng.conf:7]

    Compiling d_mail sequence [destination] at
[/etc/syslog-ng/syslog-ng.conf:3]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:3]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:3]

Compiling #unnamed sequence [log] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling s_sys reference [source] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling f_emergency reference [filter] at
[/etc/syslog-ng/syslog-ng.conf:7]

    Compiling f_emergency sequence [filter] at
[/etc/syslog-ng/syslog-ng.conf:6]

      Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:6]

  Compiling d_mlal reference [destination] at
[/etc/syslog-ng/syslog-ng.conf:7]

    Compiling d_mlal sequence [destination] at
[/etc/syslog-ng/syslog-ng.conf:4]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:4]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:4]

Compiling #unnamed sequence [log] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling s_sys reference [source] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling f_news reference [filter] at [/etc/syslog-ng/syslog-ng.conf:7]

    Compiling f_news sequence [filter] at [/etc/syslog-ng/syslog-ng.conf:6]

      Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:6]

  Compiling d_spol reference [destination] at
[/etc/syslog-ng/syslog-ng.conf:7]

    Compiling d_spol sequence [destination] at
[/etc/syslog-ng/syslog-ng.conf:4]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:4]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:4]

Compiling #unnamed sequence [log] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling s_sys reference [source] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling f_boot reference [filter] at [/etc/syslog-ng/syslog-ng.conf:7]

    Compiling f_boot sequence [filter] at [/etc/syslog-ng/syslog-ng.conf:6]

      Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:6]

  Compiling d_boot reference [destination] at
[/etc/syslog-ng/syslog-ng.conf:7]

    Compiling d_boot sequence [destination] at
[/etc/syslog-ng/syslog-ng.conf:4]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:4]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:4]

Compiling #unnamed sequence [log] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling s_sys reference [source] at [/etc/syslog-ng/syslog-ng.conf:7]

  Compiling f_cron reference [filter] at [/etc/syslog-ng/syslog-ng.conf:7]

    Compiling f_cron sequence [filter] at [/etc/syslog-ng/syslog-ng.conf:6]

      Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:6]

  Compiling d_cron reference [destination] at
[/etc/syslog-ng/syslog-ng.conf:7]

    Compiling d_cron sequence [destination] at
[/etc/syslog-ng/syslog-ng.conf:4]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:4]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:4]

Compiling #unnamed sequence [log] at [/etc/syslog-ng/syslog-ng.conf:8]

  Compiling s_net reference [source] at [/etc/syslog-ng/syslog-ng.conf:8]

    Compiling s_net sequence [source] at [/etc/syslog-ng/syslog-ng.conf:3]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:3]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:3]

  Compiling d_graylog reference [destination] at
[/etc/syslog-ng/syslog-ng.conf:8]

    Compiling d_graylog sequence [destination] at
[/etc/syslog-ng/syslog-ng.conf:4]

      Compiling #unnamed junction [log] at [/etc/syslog-ng/syslog-ng.conf:4]

        Compiling #unnamed single [log] at [/etc/syslog-ng/syslog-ng.conf:4]

Compiling #unnamed sequence [log] at [/etc/syslog-ng/syslog-ng.conf:8]

  Compiling s_sys reference [source] at [/etc/syslog-ng/syslog-ng.conf:8]

  Compiling d_graylog reference [destination] at
[/etc/syslog-ng/syslog-ng.conf:8]

Module loaded and initialized successfully; module='syslogformat'

Module loaded and initialized successfully; module='linux-kmsg-format'

Running application hooks; hook='1'

Running application hooks; hook='3'

syslog-ng starting up; version='3.5.6'

Syslog connection established; fd='9', server='AF_INET(19.211.45.55:12201)',
local='AF_INET(0.0.0.0:0)'




Syslog-ng Config




@version:3.5

@include "scl.conf"


# syslog-ng configuration file.

#

# This should behave pretty much like the original syslog on RedHat. But

# it could be configured a lot smarter.

#

# See syslog-ng(8) and syslog-ng.conf(5) for more information.

#

# Note: it also sources additional configuration files (*.conf)

#       located in /etc/syslog-ng/conf.d/


options {

    flush_lines (0);

    time_reopen (10);

    log_fifo_size (2500000);

#    chain_hostnames (off);

    use_dns (no);

    use_fqdn (no);

    create_dirs (no);

    keep_hostname (yes);

};


source s_sys {

    system();

    internal();

#     udp(ip(0.0.0.0) port(514));

};


source s_net {

udp(ip(0.0.0.0) port(514));

#tcp(ip(0.0.0.0) port(514) max-connections(256));

};


destination d_cons { file("/dev/console"); };

destination d_mesg { file("/var/log/messages"); };

destination d_auth { file("/var/log/secure"); };

destination d_mail { file("/var/log/maillog" flush_lines(10)); };

destination d_spol { file("/var/log/spooler"); };

destination d_boot { file("/var/log/boot.log"); };

destination d_cron { file("/var/log/cron"); };

destination d_kern { file("/var/log/kern"); };

destination d_mlal { usertty("*"); };



destination d_graylog {

tcp("graylog."

port (12201)

);

};



filter f_kernel     { facility(kern); };

filter f_default    { level(info..emerg) and

                        not (facility(mail)

                        or facility(authpriv)

                        or facility(cron)); };

filter f_auth       { facility(authpriv); };

filter f_mail       { facility(mail); };

filter f_emergency  { level(emerg); };

filter f_news       { facility(uucp) or

                        (facility(news)

                        and level(crit..emerg)); };

filter f_boot   { facility(local7); };

filter f_cron   { facility(cron); };


log { source(s_sys); filter(f_kernel); destination(d_cons); };

log { source(s_sys); filter(f_kernel); destination(d_kern); };

log { source(s_sys); filter(f_default); destination(d_mesg); };

log { source(s_sys); filter(f_auth); destination(d_auth); };

log { source(s_sys); filter(f_mail); destination(d_mail); };

log { source(s_sys); filter(f_emergency); destination(d_mlal); };

log { source(s_sys); filter(f_news); destination(d_spol); };

log { source(s_sys); filter(f_boot); destination(d_boot); };

log { source(s_sys); filter(f_cron); destination(d_cron); };




log { source(s_net); destination(d_graylog); };

log { source(s_sys); destination(d_graylog); };



# Source additional configuration files (.conf extension only)

@include "/etc/syslog-ng/conf.d/*.conf"



# vim:ft=syslog-ng:ai:si:ts=4:sw=4:et:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.balabit.hu/pipermail/syslog-ng/attachments/20181107/098fc709/attachment-0001.html>


More information about the syslog-ng mailing list