博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Logstash_Apache日志采集
阅读量:5152 次
发布时间:2019-06-13

本文共 1461 字,大约阅读时间需要 4 分钟。

[root@Cagios logstash-2.1.0]# cat /usr/local/logstash-2.1.0/logstash_agent.conf input {  file {    type => "apache_access"    path => ["/var/log/httpd/access_log"]  }}filter {  grok {    match => {
"message" => "%{COMBINEDAPACHELOG}"} }}output { stdout {codec => rubydebug } redis { host => '192.168.55.133' data_type => 'list' key => 'logstash:redis' }}

 

# 采集到的日志格式{        "message" => "192.168.55.1 - - [08/Dec/2015:12:35:21 +0800] \"POST /zabbix/jsrpc.php?output=json-rpc HTTP/1.1\" 200 64 \"http://192.168.55.132/zabbix/hostgroups.php?sid=ec7705df8ce1f99f\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36\"",       "@version" => "1",     "@timestamp" => "2015-12-08T04:35:21.342Z",           "host" => "0.0.0.0",           "path" => "/var/log/httpd/access_log",           "type" => "apache_access",       "clientip" => "192.168.55.1",          "ident" => "-",           "auth" => "-",      "timestamp" => "08/Dec/2015:12:35:21 +0800",           "verb" => "POST",        "request" => "/zabbix/jsrpc.php?output=json-rpc",    "httpversion" => "1.1",       "response" => "200",          "bytes" => "64",       "referrer" => "\"http://192.168.55.132/zabbix/hostgroups.php?sid=ec7705df8ce1f99f\"",          "agent" => "\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36\""}

 

转载于:https://www.cnblogs.com/caoguo/p/5028719.html

你可能感兴趣的文章
MongoDB快速入门学习笔记2 MongoDB的概念及简单操作
查看>>
2017.3.24上午
查看>>
[资源]开源项目汇总
查看>>
Spring学习整合hibernate(四)
查看>>
K-mean聚类算法汇聚有用信息——学习笔记
查看>>
凯撒密码、GDP格式化输出、99乘法表
查看>>
stm32打怪升级之不要碰中断
查看>>
Python-常用模块及简单的案列
查看>>
careercup-C和C++ 13.9
查看>>
数据库笔记
查看>>
JS+Flash 复制到剪切板(跨浏览器)
查看>>
java Web(1)
查看>>
C#创建windows服务并发布
查看>>
改良版twitter for iphone的照片分享程序
查看>>
flask框架中,利用数据库增删查改
查看>>
ie7下的<input type="text">高度
查看>>
11、自定义标签
查看>>
1--单独使用jdbc开发问题总结
查看>>
CALayer---iOS-Apple苹果官方文档翻译之CALayer
查看>>
LintCode 819. 单词排序
查看>>