rsyslog配置文件详解(rsyslog.conf)
# rsyslog configuration file # For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html # If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html #### MODULES #### ####模块#### # The imjournal module bellow is now used as a message source instead of imuxsock #加载输入模块(消息来源) $ModLoad imuxsock # provides support for local system logging (e.g. via logger command)(提供对本地系统日志的支持(例如通过记录器命令)) $ModLoad imjournal # provides access to the systemd journal(提供对systemd日志的访问) #$ModLoad imklog # reads kernel messages (the same are read from journald)(读取内核消息(从日志读取相同的消息)) #$ModLoad immark # provides --MARK-- message capability(提供--MARK--消息功能) # Provides UDP syslog reception #接收使用UDP 协议转发过来的日志 $ModLoad imudp $UDPServerRun # Provides TCP syslog reception #接收使用TCP 协议转发过来的日志 #$ModLoad imtcp #$InputTCPServerRun #注意:两个协议可以同时监听 #### GLOBAL DIRECTIVES ####
#定义日志格式默认模板 # Where to place auxiliary files $WorkDirectory /var/lib/rsyslog # Use default timestamp format $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat $template myFormat,"%timestamp% %fromhost-ip% %msg%\n" #定义模板 $template tplname, string/list/subtree/plugin $ActionFileDefaultTemplate myFormat #默认使用myFormat模板 # File syncing capability is disabled by default. This feature is usually not required, #默认情况下禁用文件同步功能。 通常不需要此功能 # not useful and an extreme performance hit #$ActionFileEnableSync on # Include all config files in /etc/rsyslog.d/ #将所有配置文件包含在/etc/rsyslog.d/ $IncludeConfig /etc/rsyslog.d/*.conf # Turn off message reception via local log socket; #通过本地日志socket,关闭信息接收 # local messages are retrieved through imjournal now. $OmitLocalLogging on # File to store the position in the journal #文件存储在日志中的位置 $IMJournalStateFile imjournal.state #### RULES #### #定义规则 # Log all kernel messages to the console. # Logging much else clutters up the screen. #kern.* /dev/console #关于内核的所有日志都放到/dev/console(控制台)
# Log anything (except mail) of level info or higher. # Don't log private authentication messages! *.info;mail.none;authpriv.none;cron.none /var/log/messages #记录所有日志类型的info级别以及大于info级别的信息到/var/log/messages, #但是mail邮件信息,authpriv验证方面的信息和cron时间任务相关的信息除外 # The authpriv file has restricted access. #authpriv验证相关的所有信息存放在/var/log/secure authpriv.* /var/log/secure # Log all the mail messages in one place. #邮件的所有信息存放在/var/log/maillog; 这里有一个-符号, 表示是使用异步的方式记录, 因为日志一般会比较大 mail.* -/var/log/maillog # Log cron stuff #计划任务有关的信息存放在/var/log/cron cron.* /var/log/cron # Everybody gets emergency messages #记录所有的大于等于emerg级别信息, 以wall方式发送给每个登录到系统的人 *.emerg :omusrmsg:* # Save news errors of level crit and higher in a special file. #记录uucp,news.crit等存放在/var/log/spooler uucp,news.crit /var/log/spooler # Save boot messages also to boot.log #启动的相关信息存放在 /var/log/boot.log local7.* /var/log/boot.log # ### begin forwarding rule ### #转发规则 # The statement between the begin ... end define a SINGLE forwarding #begin ... end之间的语句定义了一个SINGLE转发 # rule. They belong together, do NOT split them. If you create multiple #规则。 他们属于一起,不要分裂。 如果你创建多个 # forwarding rules, duplicate the whole block! #转发规则,重复整个块 # Remote Logging (we use TCP for reliable delivery) #远程日志记录(我们使用TCP可靠的传送) # An on-disk queue is created for this action. If the remote host is #为此操作创建一个磁盘队列。 如果远程主机是down掉,消息被假脱机到磁盘,并在重新启动时发送。 # down, messages are spooled to disk and sent when it is up again. #$ActionQueueFileName fwdRule1 # unique name prefix for spool files #假脱机文件的唯一名称前缀 #$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible) #1gb空间限制(尽可能多使用) #$ActionQueueSaveOnShutdown on # save messages to disk on shutdown #关闭时将消息保存到磁盘 #$ActionQueueType LinkedList # run asynchronously #使用链接列表模式 #$ActionResumeRetryCount -1 # infinite retries if host is down #如果主机关闭,则会无限重试 # remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional #*.* @@remote-host:514 *.* @@localhost:5000 #@@表示通过tcp协议发送 @表示通过udp进行转发 # ### end of the forwarding rule ###
延伸知识点:
1. 假脱机
在信息学中,假脱机(外部设备联机并行操作,SPOOL,Simultaneous Peripheral Operations On-line)是一种数据缓冲,指传输数据的过程中,将数据存放在临时工作区中。其它程序可以在之后的任意时间点对其存取。通常英语动词spool可以指储存设备的行为,具体表现为物理意义上的缠或卷,就比如说磁带机。最常见的假脱机的应用是打印缓存,即把打印任务加入到队列。
rsyslog配置文件详解(rsyslog.conf)的更多相关文章
- Rsyslog配置文件详解
Rsyslog配置文件详解https://my.oschina.net/0757/blog/198329 # Save boot messages also to boot.log 启动的相关信息lo ...
- 客户端rsyslog配置文件详解
客户端rsyslog配置文件详解 最近再开发一个rsyslog的接收服务端,支持udp,tcp和tls三种协议.所以去仔细研究了一下rsyslog.conf的配置文件,下面来详细说一下. 因为我这儿重 ...
- 手工配置rsyslog配置文件详解
手工配置 如果您无法通过脚本生成配置文件,这份指导将帮助您通过简单的复制.粘贴手动完成配置. 假定您已拥有root或sudo权限,是在通用的Linux平台使用5.8.0或更高版本的rsyslog,rs ...
- Rsyslog配置文件详解(转)
最近在搭建日志审计服务器,使用了rsyslog,发现这篇文章很有用,收藏一下. 原文链接:http://my.oschina.net/0757/blog/198329 具体内容: 非常详细的rsysl ...
- Influxdb配置文件详解---influxdb.conf
官方介绍:https://docs.influxdata.com/influxdb/v1.2/administration/config/ 全局配置 1 2 reporting-disabled = ...
- 一、Nginx配置文件详解
配置文件介绍 主要有两部分:分别是 main:主体部分 http{}:虚拟主机配置部分 配置指令主要以分号结尾:配置语法:directive value1 [value2 ....] 支持使用的变量 ...
- Nginx配置配置文件详解
文章目录 配置文件 nginx.conf配置文件详解 用于调试.定位问题的配置参数 正常运行必备的配置参数 优化性能的配置参数 事件相关配置 Fastcgi相关配置参数 常需要调整的参数 nginx作 ...
- zabbix_server.conf、zabbix_agentd.conf配置文件详解
zabbix_server.conf配置文件详解 AlertScriptsPath 默认值:/usr/local/share/zabbix/alertscripts 说明:告警脚本目录 AllowRo ...
- php-fpm.conf 配置文件详解
php-fpm.conf 配置文件详解 [global] pid = run/php-fpm.pid error_log = log/php-fpm.log log_level = notice # ...
随机推荐
- 回文词 (Palindromes,Uva401)
例题 3-3 回文词 (Palindromes,Uva401) 输入一个字符中,判断它是否为回文串以及镜像串.输入字符串保证不含数字0.所谓回文串,就是反转以后和原串相同,如abba和madam.所有 ...
- 关于typedef在struct使用上的一些问题
typedef struct lnode{ int data; struct lnode next; }lnode,linklist; 第一行的lnode是结构体名,最后一行的lnode是由typed ...
- 笔记(assert 断言)
并发:在同一个时间段交替执行多个任务并行:在同一个时间点同时执行多个任务串行:同时执行的多个任务按顺序执行(换句话说就是一个任务执行完后才能执行下一个任务) #mysql limit用法: selec ...
- SAP OData $batch processing
例として.1回の呼び出しで100個の新しい商品を作成したい場合.最も簡単な方法は.$ batch要求を使用して100個のPOST呼び出しすべてを単一のサービス呼び出しにまとめることです. URIの末尾 ...
- 10 Quality Free Flat Icon Sets for Your Designs
Subscribe It’s clear that flat design has gained great popularity in recent years. This is hardly su ...
- SSM-CRUD入门项目——查询
查询 1.基础查询 分析:访问项目主页 index.jsp 时应该跳转到列表页 我们可以在index.jsp发出查询员工列表请求,来到 list.jsp 使用插件 pageHelper 完成分页功能— ...
- 20155320 实验二 Java面向对象程序设计
20155320 实验二 Java面向对象程序设计 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O.L.I.D原则 了解设计模式 实验步 ...
- Spring学习(十一)-----Spring使用@Required注解依赖检查
Spring学习(九)-----Spring依赖检查 bean 配置文件用于确定的特定类型(基本,集合或对象)的所有属性被设置.在大多数情况下,你只需要确保特定属性已经设置但不是所有属性.. 对于这种 ...
- XAF.web.NewUI:如何自定义主题
一.使用主题制作工具导出主题: 修改主题生成器工具导出的主题.改完后,导出到 App_Themes 文件夹.例如,更改 ASPxGridView 组面板和Pager面板背景色并保存更改. 使用Them ...
- MySQL数据库之数据类型和完整性约束
补充: select * from mysql.user #显示出来乱了 select * from mysql.user\G #加了\G后一行一行显示了 一.数据类型:分不同种类去存不同类型的数据 ...