logstash 通过type判断
[elk@zjtest7-frontend type]$ cat input.conf
input {
file {
type => "type_a"
path => ["/usr/local/logstash-2.3.4/config/type/a.txt"]
} file {
type => "type_b"
path => ["/usr/local/logstash-2.3.4/config/type/b.txt"]
} } output {
if [type] == "type_a" {
redis {
host => "192.168.32.67"
data_type => "list"
key => "type_a:redis"
port=>"6379"
password => "1234567"
}
}
else if [type] == "type_b"{
redis {
host => "192.168.32.67"
data_type => "list"
key => "type_b:redis"
port=>"6379"
password => "1234567"
}
}
}
--------------------------------------------------- [elk@zjtest7-frontend type]$ cat output.conf
input { redis {
host => "192.168.32.67"
data_type => "list"
key => "type_a:redis"
password => "1234567"
port =>"6379"
} redis {
host => "192.168.32.67"
data_type => "list"
key => "type_b:redis"
password => "1234567"
port =>"6379"
} }
output {
if [type] == "type_a"{
stdout {
codec => rubydebug
}
}
else if [type] == "type_b"{
stdout {
codec =>json
} } } [elk@zjtest7-frontend type]$ ../../bin/logstash -f output.conf
Settings: Default pipeline workers: 1
Pipeline main started
{
"message" => "aaaaaaaa",
"@version" => "1",
"@timestamp" => "2016-09-16T06:26:07.211Z",
"path" => "/usr/local/logstash-2.3.4/config/type/a.txt",
"host" => "0.0.0.0",
"type" => "type_a"
} {"message":"aaaaaaaa","@version":"1","@timestamp":"2016-09-16T06:26:31.079Z","path":"/usr/local/logstash-2.3.4/config/type/b.txt","host":"0.0.0.0","type":"type_b"}
logstash 通过type判断的更多相关文章
- logstash 根据type 判断输出
# 更多ELK资料请访问 http://devops.taobao.com 一.配置前需要注意: 1.Use chmod to modify nginx log file privilege. E.g ...
- Logstash type来标记事件类型,通过type判断
/*************** 根据type判断 input { file { type => "zj_frontend_access" path => [" ...
- 浏览器解析js和type判断数据类型
### 浏览器解析: - 1.当浏览器(内核.引擎)解析和渲染js的时候,会给js提供一个运行的环境,这个环境叫做“全局作用域(后端global / 客服端window scope)” - 2.代码自 ...
- 类型(type)判断
windows下源文件编码问题 在windows下不要直接右击桌面创建.txt再改成.c,这种方式容易引起编码问题 windows下gvim的设置: 先打开gvim再用:w newfile.c这种方式 ...
- Python中为什么推荐使用isinstance来进行类型判断?而不是type
转自:http://www.xinxingzhao.com/blog/2016/05/23/python-type-vs-isinstance.html Python在定义变量的时候不用指明具体的的类 ...
- .NET(C#):判断Type类的继承关系
//Type类的函数 class Type bool IsInstanceOfType(object); //判断对象是否是指定类型 //类型可以是父类,接口 //用法:父类.IsInstanceOf ...
- ELK学习笔记之Logstash详解
0x00 Logstash概述 官方介绍:Logstash is an open source data collection engine with real-time pipelining cap ...
- logstash之Input插件
1:stdin标准输入和stdout标准输出 首先执行命令: bin/logstash -e 'input { stdin { } } output { stdout { codec => ...
- Python 判断变量的类型
这里有两种方法.type 和isinstance import types aaa = 0 print type(aaa) if type(aaa) is types.IntType: print & ...
随机推荐
- [LeetCode] 134. Gas Station 解题思路
There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You ...
- 计算N!的质因数2的个数
容易得出N!质因数2的个数 = [N / 2] + [N / 4] + [N / 8] + .... 下面通过一个简单的例子来推导一下过程:N = 10101(二进制表示)现在我们跟踪最高位的1,不考 ...
- hdu1547之BFS
Bubble Shooter Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) T ...
- Web服务的体系架构
Web简介: Web是WWW(World Wide Web)的简称,又称为万维网,是建立在客户机/服务器上的,以HTML语言和HTML协议为基础,提供面向Internet服务的,有一致用户界面的一种信 ...
- 在Centos 5.6下安装 redis
先引用redis官方(http://redis.io/) 的介绍: Redis is an open source, advanced key-value store.<br>It is ...
- 判断是否是IP地址
static bool IsIP(QString IP) { QRegExp RegExp("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\ ...
- mysql主从监控
要求:检测myslq从库状态,跳过固定的错误号,每隔30秒检测一次,如果符合条件自动跳过或者是重启从库 1)取出mysql从库的关键字 [root@localhost scripts]# mysql ...
- Python字符串格式符号含义
====== #字符串格式化符号含义 #%C 格式化字符串及其ASCLL码 >>> '%c' %97 'a' >>> '%c' % 97 'a' >>& ...
- linux命令帮助
Linux命令格式:command [options] [arguments]command:命令options: 参数 [] 表示是可选的;<> 表示是可变化的; x|y|z 表示只能选 ...
- Linux实现密钥登陆
公司为了安全,一直都采用密钥登陆远程SSH,现在有了自己的服务器,自己又学者配了一把,下面就是配置笔记. 1.登陆未设置密钥的Linux服务器 2.工具新建用户密钥生成向导 3.选择生成密钥的加密方式 ...