AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 817510
Accepted
WoJ
WoJ
Asked: 2016-11-29 08:19:26 +0800 CST2016-11-29 08:19:26 +0800 CST 2016-11-29 08:19:26 +0800 CST

尽管有适当的配置,为什么不转发 syslog 消息?

  • 772

我想将 ( rsyslog 8.4.2-1) 所有 syslog 消息转发到127.0.0.1. 为此,我在以下位置添加了一个文件/etc/rsyslog.d/expose-42000.conf:

*.* @127.0.0.1:42000

重新启动 rsyslog(日志中没有错误消息)后,我尝试收听传入消息:

netcat -u 127.0.0.1 42000

尽管出现了消息,但没有输出/var/log/syslog。

为了确保确实包含该文件,我在调试模式下运行了 rsyslogd,我看到包含发生了:

# rsyslogd -dn
(...)
8836.556859167:main thread    : requested to include config file '/etc/rsyslog.d/expose-42000.conf'
8836.556895084:main thread    : config parser: pushed file /etc/rsyslog.d/expose-42000.conf on top of stack
Next token is token PRIFILT ()
Shifting token PRIFILT ()
Entering state 14
Reading a token: Next token is token LEGACY_ACTION ()
Shifting token LEGACY_ACTION ()
Entering state 12
Reducing stack by rule 35 (line 168):
   $1 = token LEGACY_ACTION ()
8836.557893160:main thread    : tried selector action for builtin:omfile: -2001
8836.557908388:main thread    : tried selector action for builtin:ompipe: -2001
8836.557923233:main thread    : tried selector action for builtin-shell: -2001
8836.558022055:main thread    : tried selector action for builtin:omdiscard: -2001
8836.558038075:main thread    : tried selector action for builtin:omfwd: 0
8836.558052488:main thread    : Module builtin:omfwd processes this action.
8836.558136499:main thread    : template: 'RSYSLOG_TraditionalForwardFormat' assigned
8836.558160039:main thread    : action 1 queue: parameter dump:
8836.558174916:main thread    : action 1 queue: queue.filename '[NONE]'
8836.558273542:main thread    : action 1 queue: queue.size: 1000
8836.558288080:main thread    : action 1 queue: queue.dequeuebatchsize: 16
8836.558302414:main thread    : action 1 queue: queue.maxdiskspace: 0
8836.558368788:main thread    : action 1 queue: queue.highwatermark: -1
8836.558384865:main thread    : action 1 queue: queue.lowwatermark: -1
8836.558413762:main thread    : action 1 queue: queue.fulldelaymark: -1
8836.558442666:main thread    : action 1 queue: queue.lightdelaymark: -1
8836.558470770:main thread    : action 1 queue: queue.discardmark: 980
8836.558552633:main thread    : action 1 queue: queue.discardseverity: 8
8836.558594909:main thread    : action 1 queue: queue.checkpointinterval: 0
8836.558608920:main thread    : action 1 queue: queue.syncqueuefiles: 0
8836.558623042:main thread    : action 1 queue: queue.type: 3 [Direct]
8836.558691335:main thread    : action 1 queue: queue.workerthreads: 1
8836.558727077:main thread    : action 1 queue: queue.timeoutshutdown: 0
8836.558741599:main thread    : action 1 queue: queue.timeoutactioncompletion: 1000
8836.558827751:main thread    : action 1 queue: queue.timeoutenqueue: 50
8836.558855694:main thread    : action 1 queue: queue.timeoutworkerthreadshutdown: 60000
8836.558869846:main thread    : action 1 queue: queue.workerthreadminimummessages: -1
8836.558884102:main thread    : action 1 queue: queue.maxfilesize: 1048576
8836.558950182:main thread    : action 1 queue: queue.saveonshutdown: 1
8836.558983020:main thread    : action 1 queue: queue.dequeueslowdown: 0
8836.558997187:main thread    : action 1 queue: queue.dequeuetimebegin: 0
8836.559011113:main thread    : action 1 queue: queuedequeuetimend.: 25
8836.559025491:main thread    : Action 0xb97a40: queue 0xb99120 created
-> $$ = nterm s_act ()
Stack now 0 1 14
Entering state 22
Reducing stack by rule 32 (line 164):
   $1 = nterm s_act ()
-> $$ = nterm actlst ()
Stack now 0 1 14
Entering state 21
Reading a token: 8836.559386173:main thread    : config parser: reached end of file /etc/rsyslog.d/expose-42000.conf
8836.559390418:main thread    : config parser: resume parsing of file /etc/rsyslog.conf at line 51
(...)

有什么我想念的吗?

syslog rsyslog
  • 1 1 个回答
  • 679 Views

1 个回答

  • Voted
  1. Best Answer
    A.B
    2016-11-29T11:31:20+08:002016-11-29T11:31:20+08:00

    我认为一切都很好,但是您的 netcat 使用情况。

    我逐字记录了您的配置更改,运行了 syslogd -dn

    但后来我跑了这个:

    nc -u -l -p 42000
    

    并按预期获得了日志。-l是用来听的。您的命令试图连接到非开放/侦听 UDP 端口。

    • 4

相关问题

  • 解释dmesg的输出

  • 您将如何通过公共互联网*安全地*发送系统日志?

  • 如何将 Windows Server 2008 事件日志发送到 syslog 服务器?

  • 有没有办法过滤系统日志条目?

  • 生成模拟日志消息

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve