[root@web02 ~]# cat  /etc/logstash/conf.d/nginx.conf
input {
file {
path => "/var/log/nginx/access_log_jason.log"
codec => "json"
type => "nginx-access-log"
} } filter { } output {
elasticsearch {
hosts => ["10.0.0.18:9200"]
index => "nginx-access-log-%{+YYYY.MM.dd}" }
stdout{
codec => rubydebug
} }

#正则匹配[  ] 两个括号之间的内容

[root@web04 conf.d]# cat codec.conf
input{
stdin {
codec => multiline{
pattern => "^\["
negate => true
what => "previous"
} } } filter{
} output{ stdout{
codec => rubydebug
} }
[root@web04 conf.d]# cat demo.conf
input {
stdin{} } filter { } output {
elasticsearch{
hosts => ["10.0.0.18:9200"]
index => "logstash-%{+YYYY.MM.dd}"
}
stdout{
codec => rubydebug
} }
=====================================
多行正则匹配 [root@web04 conf.d]# cat file.conf
input {
file{ path => ["/var/log/messages","/var/log/secure"]
type => "system-log"
start_position => "beginning"
} file {
path => ["/var/log/elasticsearch/my-es.log","/var/log/elasticsearch/my-es.log.2018-01-15"]
type => "es-log"
start_position => "beginning"
codec => multiline{
pattern => "^\["
negate => true
what => "previous"
} }
} filter { } output {
if [type] == "system-log" {
elasticsearch {
hosts => ["10.0.0.18:9200"]
index => "system-log-%{+YYYY.MM}"
}
}
if [type] == "es-log" {
elasticsearch {
hosts => ["10.0.0.18:9200"]
index => "es-log-%{+YYYY.MM}"
}
} }
================================
syslog 插件
[root@web04 conf.d]# cat sys.log
input { syslog{ type => "system-syslog"
port => 514
} } output {
elasticsearch {
hosts => ["10.0.0.18:9200"]
index => "system-syslog-%{+YYYY.MM}"
} }
=============== #TCP 通过端口传送到一个文件
[root@web04 conf.d]# cat tcp.conf
input {
tcp { type => "tcp"
port => "6666"
mode => "server" } } filter { } output { stdout {
codec => rubydebug
} }

ELK之jason配置nginx文件等多个配置文件的更多相关文章

  1. ELK 6安装配置 nginx日志收集 kabana汉化

    #ELK 6安装配置 nginx日志收集 kabana汉化 #环境 centos 7.4 ,ELK 6 ,单节点 #服务端 Logstash 收集,过滤 Elasticsearch 存储,索引日志 K ...

  2. nginx 文件服务器配置,模板配置文件,有注释

    # For more information on configuration, see: # * Official English Documentation: http://nginx.org/e ...

  3. 在阿里云创建子域名,配置nginx,使用pm2部署node项目到ubuntu服务器

    配置域名 在阿里云找到主域名 进入主域名之后,右上角添加解析,添加子域名, 记录类型选择cname,主机记录填写子域名的名称,记录值为主域名,至此阿里云已经配置好了. 检查nginx安装 首先检查服务 ...

  4. win10环境安装配置Nginx

    前言: 参考 https://blog.csdn.net/kisscatforever/article/details/73129270 Nginx的应用场景      1. http服务器.Ngin ...

  5. 配置LANMP环境(7)-- 配置nginx反向代理,与配置apache虚拟主机

    一.配置nginx反向代理 1.修改配置文件 vim /etc/nginx/nginx.conf 在35行http下添加一下内容: include /data/nginx/vhosts/*.conf; ...

  6. JAVA加载Properties配置资源文件

    JAVA加载Properties配置资源文件 制作人:全心全意 配置文件(资源文件):以properties作为拓展名的文件 Java代码是如何加载properties文件的? 必须使用Propert ...

  7. Ubuntu 16.04下配置 Nginx 与 Node.js 以及服务的部署

    第一步:安装nginx sudo apt-get update sudo apt-get install nginx 如果遇到依赖问题,尝试执行sudo apt-get -f install命令 第二 ...

  8. CentOS下配置nginx conf/koi-win为同一文件的各类错误

    今天配置CentOS6.5下安装Nginx + php7 + mysql5.7.15遇到了一些坑.本来家里的电脑在配置环境的时候没有问题,拿去公司的电脑上就是到处报错.不知道是不是人品问题.今晚在家重 ...

  9. 通过HTTP服务访问FTP服务器文件(配置nginx+ftp服务器)

    1.前提 已安装配置好nginx+ftp服务 2.配置Nginx 服务器 2.1进入nginx 配置文件目录: cd  /usr/local/nginx/conf vi  nginx.conf 2.2 ...

随机推荐

  1. (转)stage 3d or unity 3d

    这个是这样子的.stage3d如果不使用flascc的话,性能会卡在as上面.你没卡是因为你用的效果还不够高级.往深了走的高端应用就是卡as性能上.这不是你代码能优化了的.我们后来都改用flascc写 ...

  2. Mac下Gmail不能访问的简单解决办法

    思路:Hosts Terminal下输入: curl -s http://freedom.txthinking.com/fuckGFW.py | sudo python 按提示输入密码即可 比较方便, ...

  3. TranslateAnimation详解 Android动画。

    TranslateAnimation详解 Android JDK为我们提供了4种动画效果,分别是: AlphaAnimation,RotateAnimation, ScaleAnimation, Tr ...

  4. 关于poedit打开po文件乱码的问题

    由于poedit打开po文件时,无法识别译文使用的何种编码,因此需要在po文件头部加上以下代码: msgid "" msgstr "" "Plural ...

  5. 如何快速搜索SQL数据库数据和对象

    原文 如何快速搜索SQL数据库数据和对象 Frequently, developers and DBAs need to search databases for objects or data. I ...

  6. linux tail指令

    http://www.cnblogs.com/peida/archive/2012/11/07/2758084.html tail -f file,  check the log file tail  ...

  7. 【spring boot】14.spring boot集成mybatis,注解方式OR映射文件方式AND pagehelper分页插件【Mybatis】pagehelper分页插件分页查询无效解决方法

    spring boot集成mybatis,集成使用mybatis拖沓了好久,今天终于可以补起来了. 本篇源码中,同时使用了Spring data JPA 和 Mybatis两种方式. 在使用的过程中一 ...

  8. eclipse进行Debug的时候,发出“java breakpoint unable to install breakpoint”错误

    错误情况图: 问题的解决方法: 直接点击忽略掉:Don't tell me again 来自网上的答案~~ I had the same error message in Eclipse 3.4.1, ...

  9. ES的关键端口

    ElasticSearch的集群可自发现,只要配置相同的集群名称,默认为组播发现机制,默认情况下: http 端口:9200 需要打开给调用 数据传输端口:9300 用于集群之间交换数据 组播端口(U ...

  10. [Algorithms] Refactor a Linear Search into a Binary Search with JavaScript

    Binary search is an algorithm that accepts a sorted list and returns a search element from the list. ...