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 & ...
随机推荐
- 高级私人定制西服品牌:XUAN PRIVE 为定制而生_乐活_onlylady女人志
高级私人定制西服品牌:XUAN PRIVE 为定制而生_乐活_onlylady女人志 高级私人定制西服品牌:XUAN PRIVE 为定制而生
- 关于C/C++函数指针声明的理解
[前言] 由于最近对函数指针的理解比较模糊,所有又重新学习了一把关于函数指针的知识,参考了很多书籍和网上的文章.现在本人进行一下分享和总结.本文的其实只是整理和总结别人现有的文章,作为备用参考文档. ...
- WingIDE注册破解方法
WingIDE是Python程序语言设计的集成开发环境,具有语法标签高亮显示,命令自动完成和函数跳转列表等非常强大的功能.本文主要介绍WingIDE 5安装及注册破解方法. 1. WingIDE 5下 ...
- 解决Xcode8 输出一对字符串问题
在Product->Scheme->Edit Scheme->Run->Environment Variables下添加键:OS_ACTIVITY_MODE, 值:Disabl ...
- 【Python基础】计算项目代码行数
统计代码行数 # coding: utf-8 import os import sys import time def get_line_count(file_path): ""& ...
- android学习笔记---63-PopupWindow,泡泡窗口的实现
转载http://blog.csdn.net/lidew521/article/details/8976627 PopupWindow是一个可以显示在当前Activity之上的浮动容器,PopupWi ...
- hdu5067Harry And Dig Machine(TSP旅行商问题)
题目链接: huangjing 题意:给出一幅图.图中有一些点,然后从第1个点出发,然后途径全部有石头的点.最后回到原点,然后求最小距离.当初作比赛的时候不知道这就是旅行商经典问题.回来学了一下. 思 ...
- .NET基础拾遗(7)多线程开发基础1
一.多线程编程的基本概念 1.1 操作系统层面的进程和线程 (1)进程 进程代表了操作系统上运行着的一个应用程序.进程拥有自己的程序块,拥有独占的资源和数据且可以被操作系统调度. But,即使是同一个 ...
- DataGrid( 数据表格) 组件[6]
本节课重点了解 EasyUI 中 DataGrid(数据表格)组件的使用方法,这个组件依赖于Panel(面板).Resizeable(调整大小).LinkButton(按钮).Pageination( ...
- C# 无边框窗体移动代码
C# 无边框窗体移动代码 Point _frmPoint = new Point(); //移动前窗体左上角坐标 Point _mousePoint = new Point(); //按下鼠标时坐标 ...