ELK之jason配置nginx文件等多个配置文件
[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文件等多个配置文件的更多相关文章
- ELK 6安装配置 nginx日志收集 kabana汉化
#ELK 6安装配置 nginx日志收集 kabana汉化 #环境 centos 7.4 ,ELK 6 ,单节点 #服务端 Logstash 收集,过滤 Elasticsearch 存储,索引日志 K ...
- nginx 文件服务器配置,模板配置文件,有注释
# For more information on configuration, see: # * Official English Documentation: http://nginx.org/e ...
- 在阿里云创建子域名,配置nginx,使用pm2部署node项目到ubuntu服务器
配置域名 在阿里云找到主域名 进入主域名之后,右上角添加解析,添加子域名, 记录类型选择cname,主机记录填写子域名的名称,记录值为主域名,至此阿里云已经配置好了. 检查nginx安装 首先检查服务 ...
- win10环境安装配置Nginx
前言: 参考 https://blog.csdn.net/kisscatforever/article/details/73129270 Nginx的应用场景 1. http服务器.Ngin ...
- 配置LANMP环境(7)-- 配置nginx反向代理,与配置apache虚拟主机
一.配置nginx反向代理 1.修改配置文件 vim /etc/nginx/nginx.conf 在35行http下添加一下内容: include /data/nginx/vhosts/*.conf; ...
- JAVA加载Properties配置资源文件
JAVA加载Properties配置资源文件 制作人:全心全意 配置文件(资源文件):以properties作为拓展名的文件 Java代码是如何加载properties文件的? 必须使用Propert ...
- Ubuntu 16.04下配置 Nginx 与 Node.js 以及服务的部署
第一步:安装nginx sudo apt-get update sudo apt-get install nginx 如果遇到依赖问题,尝试执行sudo apt-get -f install命令 第二 ...
- CentOS下配置nginx conf/koi-win为同一文件的各类错误
今天配置CentOS6.5下安装Nginx + php7 + mysql5.7.15遇到了一些坑.本来家里的电脑在配置环境的时候没有问题,拿去公司的电脑上就是到处报错.不知道是不是人品问题.今晚在家重 ...
- 通过HTTP服务访问FTP服务器文件(配置nginx+ftp服务器)
1.前提 已安装配置好nginx+ftp服务 2.配置Nginx 服务器 2.1进入nginx 配置文件目录: cd /usr/local/nginx/conf vi nginx.conf 2.2 ...
随机推荐
- Path Sum II (Find Path in Tree) -- LeetCode
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given su ...
- SPOJ705 SUBST1 - New Distinct Substrings(后缀数组)
给一个字符串求有多少个不相同子串. 每一个子串一定都是某一个后缀的前缀.由此可以推断出总共有(1+n)*n/2个子串,那么下面的任务就是找这些子串中重复的子串. 在后缀数组中后缀都是排完序的,从sa[ ...
- Creating and Flashing UBIFS with MTD Utils
转:http://wiki.atlas-embedded.com/index.php?title=Creating_and_Flashing_UBIFS_with_MTD_Utils Contents ...
- 记一次有惊无险的Linux数据恢复过程
问题阶段 起因: 昨天晚上思路不是很清晰(上了一天班回来有点蒙),还是强忍着疲惫想搞事情,结果悲剧了… … 本来想拿SD卡做一张linux烧录卡,烧录脚本是很久以前写的,有git记录,一直不成功,就回 ...
- crontab配置
1.命令功能 通过crontab 命令,我们可以在固定的间隔时间执行指定的系统指令或 shell script脚本.时间间隔的单位可以是分钟.小时.日.月.周及以上的任意组合.这个命令非常适合周期性的 ...
- 【Hadoop】Hadoop MR 性能优化 Combiner机制
1.概念 2.参考资料 提高hadoop的mapreduce job效率笔记之二(尽量的用Combiner) :http://sishuo(k).com/forum/blogPost/list/582 ...
- EF使用延迟加载的本质原因
EF(Entity Framework)是微软的一个ORM框架 使用过EF的同学都知道它有一个延迟加载的功能 那么这个延迟加载的功能到底是什么? 为什么需要延迟加载? 使用延迟加载的优点和缺点又各是什 ...
- 转:windows 查找pid并kill进程
找出占用1099端口的进程,进入windows命令,查看什么进程占用了1099端口 使用命令:netstat -aon|findstr 1099 找出占用1099端口的进程,如下图所示:
- vue笔记一
一.Vue基本知识点 1.声明式渲染 <div id="app">{{ msg }}</div> <script> var app = new ...
- 【Excle】8个快捷键
1.CtrL+ F1 一键切换功能区是否显示,几乎每天都要用N次. 2.Ctrl + N 一键插入新的工作簿,再不用通过新建 - 空白工作簿来操作了. 3.Shift + F2 如果单元格中没有批注会 ...