in_tailis included in Fluentd’s core. No additional installation process is required. 不需要额外的安装过程。
type tail
path /var/log/httpd-access.log
pos_file /var/log/td-agent/httpd-access.log.pos
tag apache.access
format apache2
Please see theConfig Filearticle for the basic structure and syntax of the configuration file.
请参阅 Config File
的基本结构和文章语法的配置文件。
How it Works
When Fluentd is first configured within_tail, it will start reading from thetailof that log, not the beggining.
Once the log is rotated, Fluentd starts reading the new file from the beggining. It keeps track of the current inode number.
Iftd-agentrestarts, it starts reading from the last position td-agent read before the restart. This position is recorded in the position file specified by the pos_file parameter.
The format of the log. Itis the name of a template or regexp surrounded by ‘/’.
该日志的格式。它是模板的名称或是正则表达式‘/’包围。
The regexp must have at least one named capture(?PATTERN). If the regexp has a capture named ‘time’, it is used as the time of the event. You can specify the time format using the time_format parameter. If the regexp has a capture named ‘tag’, the tag parameter + the captured tag is used as the tag of the event.
正则表达式必须至少有一个名叫捕获
(? <名称>模式)。如果正则表达式有一个捕捉名为“time”,它是用作事件的时间。你可以使用时间格式参数指定时间格式。如果正则表达式有一个捕捉名为“tag”, tag 参数+捕获的 tag 是作为标记的事件。
The following templates are supported:
以下模板支持:
regexp
正则表达式
The regexp for the format parameter can be specified.Fluentularis a great website to test your regexp for Fluentd configuration.
Reads apache’s log file for the following fields: host, user, time, method, path, code, size, referer and agent. This template is analogous to the following configuration:
Reads syslog’s output file (e.g. /var/log/syslog) for the following fields: time, host, ident, and message. This template is analogous to the following configuration:
读取syslog的输出文件(例如,/ var / log / syslog)对下列字段:时间、主机,识别,和消息。这个模板类似于如下配置:
format /^(?
tsvorcsv
If you use tsv or csv format, please also specify thekeysparameter.
如果你使用tsv或csv格式,也请指定键参数。
format tsv
keys key1, key2, key3
time_key key2
If you specify thetime_keyparameter, it will be used to identify the timestamp of the record. The timestamp when Fluentd reads the record is used by default.
One JSON map, per line. This is the most straight forward format :).
format json
Thetime_keyparameter can also be specified.
format json
time_key key3
pos_file (highly recommended)
pos文件(强烈推荐)
This parameter is highly recommended. Fluentd will record the position it last read into this file.
这个参数是高度推荐。Fluentd将记录它上次读到这个文件的位置。
pos_file /var/log/td-agent/tmp/access.log.pos
time_format 时间格式
The format of the time field. This parameter is required only if the format includes a ‘time’ capture and it cannot be parsed automatically. Please seeTime#strftimefor additional information.
in_tail actually does a bit more thantail -Fitself. When rotating a file, some data may still need to be written to the old file as opposed to the new one.
in_tail takes care of this by keeping a reference to the old file (even after it has been rotated) for some time before transitioning completely to the new file. This helps prevent data designated for the old file from getting lost. By default, this time interval is 5 seconds.
eclipse中使用maven插件的时候,运行run as maven build的时候报错
-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.
可以设一个环境变量M2_HOME指
1.建好一个专门放置MySQL的目录
/mysql/db数据库目录
/mysql/data数据库数据文件目录
2.配置用户,添加专门的MySQL管理用户
>groupadd mysql ----添加用户组
>useradd -g mysql mysql ----在mysql用户组中添加一个mysql用户
3.配置,生成并安装MySQL
>cmake -D
好久没有去安装过MYSQL,今天自己在安装完MYSQL过后用navicat for mysql去厕测试链接的时候出现了10061的问题,因为的的MYSQL是最新版本为5.6.24,所以下载的文件夹里没有my.ini文件,所以在网上找了很多方法还是没有找到怎么解决问题,最后看到了一篇百度经验里有这个的介绍,按照其步骤也完成了安装,在这里给大家分享下这个链接的地址
import java.io.UnsupportedEncodingException;
/**
* 转换字符串的编码
*/
public class ChangeCharset {
/** 7位ASCII字符,也叫作ISO646-US、Unicode字符集的基本拉丁块 */
public static final Strin
其实这个没啥技术含量,大湿们不要操笑哦,只是做一个简单的记录,简单用了一下递归算法。
import java.io.File;
/**
* @author Perlin
* @date 2014-6-30
*/
public class PrintDirectory {
public static void printDirectory(File f
linux安装mysql出现libs报冲突解决
安装mysql出现
file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-5.5.33-1.linux2.6.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686
Dear,
I'm pleased to announce that ktap release v0.1, this is the first official
release of ktap project, it is expected that this release is not fully
functional or very stable and we welcome bu