nginx日志怎么在elasticsearch head中显示出来

ELK Stack (2) —— ELK + Redis收集Nginx日志
使用Elasticsearch、Logstash、Kibana与Redis(作为缓冲区)对Nginx日志进行收集
elasticsearch版本: elasticsearch-2.2.0
logstash版本: logstash-2.2.2
kibana版本: kibana-4.3.1-darwin-x64
jdk版本: jdk1.8.0_65
参考以下文章安装好ELK与Redis
以CAS系列中的使用的Nginx负载均衡器为例
修改nginx.conf
log_format logstash '$http_host $server_addr $remote_addr [$time_local] &$request& '
'$request_body $status $body_bytes_sent &$http_referer& &$http_user_agent& '
'$request_time $upstream_response_time';
Elasticsearch
修改elasticsearch.yml
cluster.name: logstash_elasticsearch
http.cors.allow-origin: &/.*/&
http.cors.enabled: true
/logstash/conf/logstash_agent.conf
type =& &nginx_access&
path =& [&/usr/share/nginx/logs/test.access.log&]
host =& &localhost&
data_type =& &list&
key =& &logstash:redis&
/logstash/conf/logstash_indexer.conf
host =& &localhost&
data_type =& &list&
key =& &logstash:redis&
type =& &redis-input&
match =& [
&message&, &%{WORD:http_host} %{URIHOST:api_domain} %{IP:inner_ip} %{IP:lvs_ip} \[%{HTTPDATE:timestamp}\] \&%{WORD:http_verb} %{URIPATH:baseurl}(?:\?%{NOTSPACE:request}|) HTTP/%{NUMBER:http_version}\& (?:-|%{NOTSPACE:request}) %{NUMBER:http_status_code} (?:%{NUMBER:bytes_read}|-) %{QS:referrer} %{QS:agent} %{NUMBER:time_duration:float} (?:%{NUMBER:time_backend_response:float}|-)&
prefix =& &request.&
field_split =& &&&
source =& &request&
urldecode {
all_fields =& true
type =& &log-date&
match =& [&timestamp& , &dd/MMM/YYYY:HH:mm:ss Z&]
match =& [&logdate& , &dd/MMM/YYYY:HH:mm:ss Z&]
elasticsearch {
#embedded =& false
#protocol =& &http&
hosts =& &localhost:9200&
index =& &access-%{+YYYY.MM.dd}&
注意有些网络示例为旧版本配置,新版本下output的embedded、protocol以及filter的date都有所更新。
创建Index Pattern: access-*
访问本地Kibana
阅读(...) 评论()用户名:lqbyz
文章数:100
评论数:41
访问量:89629
注册日期:
阅读量:1297
阅读量:3317
阅读量:454558
阅读量:1139202
51CTO推荐博文
(一)测试的环境agentd:192.168.180.22ES:192.168.180.23kibana:192.168.180.23采用的拓扑:logstash --&ES--&kibana(二)实施步骤:& &(1)logstsh具体配置:1,配置nginx日志格式,采用log_format格式:log_format&&main&&'$remote_addr&-&$remote_user&[$time_local]&"$request"&'
&&&&&&&&&&&&&&&&&&&&&&'$status&$body_bytes_sent&"$http_referer"&'
&&&&&&&&&&&&&&&&&&&&&&'"$http_user_agent"&"$http_x_forwarded_for"';2,在logstash服务器下载IP地址归类查询库[root@localhost&config]#&cd&/usr/local/logstash/config/
[root@localhost&config]#&&wget&/download/geoip/database/GeoLite2-City.mmdb.
gz3,配置logstash客户端[root@localhost&config]#&vim&/usr/local/logstash/config/nginx-access.conf&
&&&&&&&&file&{
&&&&&&&&&&&&&&&&path&=&&"/opt/access.log"
&&&&&&&&&&&&&&&&type&=&&"nginx"
&&&&&&&&&&&&&&&&start_position&=&&"beginning"
&&&&&&&&&&&&&&}
&&&&&&&&&&&&}
&&&&&&&&&&grok&{
&&&&&&&&&&&&&&&&match&=&&{&"message"&=&&"%{IPORHOST:remote_addr}&-&-&\[%{HTTPDATE:time_local}\]&\"%{WO
RD:method}&%{URIPATHPARAM:request}&HTTP/%{NUMBER:httpversion}\"&%{INT:status}&%{INT:body_bytes_sent}&%
{QS:http_referer}&%{QS:http_user_agent}"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&}
&&&&&&&&&&&&&&&&&&&&&}
&&&&&source&=&&"remote_addr"
&&&&&target&=&&"geoip"
&&&&&database&=&&"/usr/local/logstash/config/GeoLite2-City.mmdb"
&&&&&add_field&=&&["[geoip][coordinates]","%{[geoip][longitude]}"]
&&&&&add_field&=&&["[geoip][coordinates]","%{[geoip][latitude]}"]
&&&&&&&&&&&&&&&&}
&&&&&&&&&&&&&&&&elasticsearch&{
&&&&&&&&&&&&&&&&&&&&&&&&hosts&=&&["192.168.180.23:9200"]
&&&&&&&&&&&&&&&&&&&&&&&&manage_template&=&&true&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&index&=&&"logstash-map-%{+YYYY-MM}"&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&}备注:geoip: IP查询插件source: 需要通过geoip插件处理的field,一般为ip,这里因为通过控制台手动输入的是ip所以直接填message,生成环境中如果查询nginx访问用户,需先将客户端ip过滤出来,然后这里填remote_addr即可target: 解析后的Geoip地址数据,应该存放在哪一个字段中,默认是geoip这个字段database: 指定下载的数据库文件add_field: 这里两行是添加经纬度,地图中地区显示是根据经纬度来识。如果启动正常的话,可以在kibana看到geoip相关的字段,如下图:3,启动logstash客户端并加载刚才的配置文件。[root@localhost&config]#&/usr/local/logstash/bin/logstash&-f&nginx-access.conf&&
Sending&Logstash's&logs&to&/usr/local/logstash/logs&which&is&now&configured&via&log4j2.properties
[T22:55:23,801][INFO&][logstash.outputs.elasticsearch]&Elasticsearch&pool&URLs&updated&{:changes=&{:removed=&[],&:added=&[http://192.168.180.23:9200/]}}
[T22:55:23,805][INFO&][logstash.outputs.elasticsearch]&Running&health&check&to&see&if&an&Elasticsearch&connection&is&working&{:healthcheck_url=&http://192.168.180.23:9200/,&:path=&"/"}
[T22:55:23,901][WARN&][logstash.outputs.elasticsearch]&Restored&connection&to&ES&instance&{:url=&#&URI::HTTP:0x4e54594d&URL:http://192.168.180.23:9200/&}
[T22:55:23,909][INFO&][logstash.outputs.elasticsearch]&Using&mapping&template&from&{:path=&nil}
[T22:55:23,947][INFO&][logstash.outputs.elasticsearch]&Attempting&to&install&template&{:manage_template=&{"template"=&"logstash-*",&"version"=&50001,&"settings"=&{"index.refresh_interval"=&"5s"},&"mappings"=&{"_default_"=&{"_all"=&{"enabled"=&true,&"norms"=&false},&"dynamic_templates"=&[{"message_field"=&{"path_match"=&"message",&"match_mapping_type"=&"string",&"mapping"=&{"type"=&"text",&"norms"=&false}}},&{"string_fields"=&{"match"=&"*",&"match_mapping_type"=&"string",&"mapping"=&{"type"=&"text",&"norms"=&false,&"fields"=&{"keyword"=&{"type"=&"keyword"}}}}}],&"properties"=&{"@timestamp"=&{"type"=&"date",&"include_in_all"=&false},&"@version"=&{"type"=&"keyword",&"include_in_all"=&false},&"geoip"=&{"dynamic"=&true,&"properties"=&{"ip"=&{"type"=&"ip"},&"location"=&{"type"=&"geo_point"},&"latitude"=&{"type"=&"half_float"},&"longitude"=&{"type"=&"half_float"}}}}}}}}
[T22:55:23,955][INFO&][logstash.outputs.elasticsearch]&New&Elasticsearch&output&{:class=&"LogStash::Outputs::ElasticSearch",&:hosts=&[#&URI::Generic:0x1e098115&URL://192.168.180.23:9200&]}
[T22:55:24,065][INFO&][logstash.filters.geoip&&&]&Using&geoip&database&{:path=&"/usr/local/logstash/config/GeoLite2-City.mmdb"}
[T22:55:24,094][INFO&][logstash.pipeline&&&&&&&&]&Starting&pipeline&{"id"=&"main",&"pipeline.workers"=&4,&"pipeline.batch.size"=&125,&"pipeline.batch.delay"=&5,&"pipeline.max_inflight"=&500}
[T22:55:24,275][INFO&][logstash.pipeline&&&&&&&&]&Pipeline&main&started
[T22:55:24,369][INFO&][logstash.agent&&&&&&&&&&&]&Successfully&started&Logstash&API&endpoint&{:port=&9600}(2)Kibana配置.1,编辑修改kibana的配置文件kibana.yml在最后添加如下:#&The&default&locale.&This&locale&can&be&used&in&certain&circumstances&to&substitute&any&missing
#&translations.
#i18n.defaultLocale:&"en"
tilemap.url:&'http://webrd02./appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&
z={z}'2,重启kibana服务。[root@localhost&bin]#&/usr/local/kibana/bin/kibana&&
[root@localhost&bin]#&ps&-ef|grep&kibana&&&&&&&&&&&&
root&&&&&1&21&10:52&pts/0&&&&00:00:02&/usr/local/kibana/bin/../node/bin/node&--no-warnings&/usr/local/kibana/bin/../src/cli
root&&&&&1&&0&10:52&pts/0&&&&00:00:00&grep&--color=auto&kibana
[root@localhost&bin]#&&&log&&&[02:52:59.297]&[info][status][plugin:kibana@5.4.0]&Status&changed&from&uninitialized&to&green&-&Ready
&&log&&&[02:52:59.445]&[info][status][plugin:elasticsearch@5.4.0]&Status&changed&from&uninitialized&to&yellow&-&Waiting&for&Elasticsearch
&&log&&&[02:52:59.482]&[info][status][plugin:console@5.4.0]&Status&changed&from&uninitialized&to&green&-&Ready
&&log&&&[02:52:59.512]&[info][status][plugin:elasticsearch@5.4.0]&Status&changed&from&yellow&to&green&-&Kibana&index&ready
&&log&&&[02:52:59.513]&[info][status][plugin:metrics@5.4.0]&Status&changed&from&uninitialized&to&green&-&Ready
&&log&&&[02:53:00.075]&[info][status][plugin:timelion@5.4.0]&Status&changed&from&uninitialized&to&green&-&Ready
&&log&&&[02:53:00.080]&[info][listening]&Server&running&at&http://192.168.180.23:5601
&&log&&&[02:53:00.081]&[info][status][ui&settings]&Status&changed&from&uninitialized&to&green&-&Ready3,创建nginx的访问索引lostash-map*。具体步骤如下:ip:5601---&Management--Index Patterns---&+---&在Index name or pattern中添加logstash-map*---&create。具体如下图:4,创建Visualize。具体步骤如下:Visalize---&+---&Maps(Tile Maps)已上就是简单的步骤。本文出自 “” 博客,请务必保留此出处
了这篇文章
类别:┆阅读(0)┆评论(0)日志查询利器 Logstash和ElasticSearch
1、日志分散在各个不同的硬件设备上,特别是在分布式系统下,想找到一个日志,将是很困难的事情。
2、日志检索是一个比较麻烦的事情,通常工程师会采用grep等linux指令进行处理。但是跨时间段查询、计数等需求,需要更多的系统级别的指令综合处理才能完成。无形中增加了难度。
3、日志检索到后,可能有成千上万行,工程师需要对这部分数据再进行钻取,得到最后的检索结果。
1、Logstash是一个完全开源的工具,他可以对你的日志进行收集、分析,并将其存储供以后使用(如,搜索)。
2、Elasticsearch是个开源分布式搜索引擎,它的特点有:分布式,零配置,自动发现,索引自动分片,索引副本机制,restful风格接口,多数据源,自动搜索负载等。
http://es-cn.medcl.net/
3、kibana 也是一个开源和免费的工具,他可以帮助您汇总、分析和搜索重要数据日志并提供友好的web界面。
使用上述的三个组件,可以组成一个很好的查询引擎。
650) this.width=650;” src=”http://52ml.net/images/be24bdcf1aa5.png” alt=”Logstash” width=+ height=+ style=”height:width:border:0” class=”alignCenter” />
1、在需要收集日志的服务上部署Logstash,作为Agent。
2、在中心服务器上,部署Redis,作为缓冲队列。
3、在中心服务器上,部署Logstash,作为Indexer。
4、在中心服务器上,部署ElasticSearch。
5、在中心服务器上,部署kibaba
650) this.width=650;” src=”http://52ml.net/images/fe5de2beccd2d3.png” alt=”Elasticsearch” class=”alignCenter” />
服务器准备:192.168.1.1(Nginx–日志发生文件夹) 192.168.1.2(中心服务器)
1、192.168.1.1上配置Nginx日志模式,重启
log_format logstash_json ‘{ “@timestamp”: “$time_iso8601″, ‘
‘”remote_addr”: “$remote_addr”, ‘
‘”remote_user”: “$remote_user”, ‘
‘”body_bytes_sent”: “$body_bytes_sent”, ‘
‘”request_time”: “$request_time”, ‘
‘”status”: “$status”, ‘
‘”request”: “$request”, ‘
‘”request_method”: “$request_method”, ‘
‘”http_referrer”: “$http_referer”, ‘
‘”http_user_agent”: “$http_user_agent” } }’;
access_log logs/access.log logstash_
2、192.168.1.1 上部署Logstash(Agent)
下载Logstash(https://download.elasticsearch.org/logstash/logstash/logstash-1.2.2-flatjar.jar),并上传。
path =& “/usr/local/nginx/logs/access.log”
type =& nginx # This format tells logstash to expect ‘logstash’ json events from the file.
format =& json_event}
host =& “192.168.1.2″
port =& 6371
data_type =& “list”
key =& “logstash”}
nohup java -jar logstash-1.2.2-flatjar.jar agent -f logstash.conf & nohup &
3、192.168.1.2 上部署Redis(不赘述,参考wiki)
4、192.168.1.2 上部署Logstash(Indexer)
host =& “127.0.0.1″ # these settings should match the output of the agent
data_type =& “list”
key =& “logstash”
port =& 6371 # We use the ‘json’ codec here because we expect to read # json events from redis.
codec =& json}
debug =& true
debug_format =& “json”}
elasticsearch{
host =& “127.0.0.1″}
nohup java -jar logstash-1.2.2-flatjar.jar agent -f logstash.conf & nohup &
5、192.168.1.2 上部署ElasticSearch
下载:http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.5.tar.gz
6、192.168.1.2 上部署kibana
nohup java -jar logstash-1.2.2-flatjar.jar web & web.log &
650) this.width=650;” src=”http://52ml.net/images/520c3a876b8b3ec5bbe6.jpg” alt=”Logstash Search” width=+ height=+ style=”height:width:border:0” class=”alignCenter” />
650) this.width=650;” src=”http://52ml.net/images/cb9e4cb9c6f02bda250cd30c95a8b650.jpg” alt=”Logstash Search” width=+ height=+ style=”height:width:border:0” class=”alignCenter” />
本文章作者来自于talkingdata(北京腾云天下技术团队)
本文转载自:
欢迎加入我爱机器学习QQ13群:
微信扫一扫,关注我爱机器学习公众号
欢迎加入我爱机器学习QQ13群:
最新文章列表
NIPS 2016 — Day 1 Highlights NIPS 2016 — Day 2 Highlights:...
2017年九月 &(14)
2017年八月 &(58)
2017年七月 &(60)
2017年六月 &(67)
2017年五月 &(66)
2017年四月 &(65)
2017年三月 &(54)
2017年二月 &(48)
2017年一月 &(54)
2016年十二月 &(62)
2016年十一月 &(97)
2016年十月 &(97)
2016年九月 &(124)
2016年八月 &(83)
2016年七月 &(13)
2016年六月 &(10)
2016年五月 &(7)
2016年四月 &(9)
2016年三月 &(7)
2016年二月 &(2)
2016年一月 &(3)
2015年十二月 &(5)
2015年十一月 &(4)
2015年十月 &(2)
2015年九月 &(2)
2015年八月 &(3)
2015年七月 &(6)
2015年六月 &(8)
2015年五月 &(4)
2015年四月 &(1)
2015年三月 &(3)
2015年二月 &(1)
2015年一月 &(2)
2014年十二月 &(4)
2014年十一月 &(2)
2014年十月 &(3)
2014年九月 &(4)
2014年八月 &(22)
2014年七月 &(40)
2014年六月 &(61)
2014年五月 &(63)
2014年四月 &(187)
2014年三月 &(4799)
2014年二月 &(764)
2014年一月 &(330)
2013年十二月 &(145)
2013年十一月 &(126)
2013年十月 &(216)
2013年九月 &(284)
2013年八月 &(327)
2013年七月 &(275)
2013年六月 &(315)
2013年五月 &(228)
2013年四月 &(175)
2013年三月 &(186)
2013年二月 &(118)
2013年一月 &(210)
2012年十二月 &(221)
2012年十一月 &(155)
2012年十月 &(143)
2012年九月 &(98)
2012年八月 &(99)
2012年七月 &(109)
2012年六月 &(75)
2012年五月 &(88)
2012年四月 &(78)
2012年三月 &(78)
2012年二月 &(50)
2012年一月 &(17)
2011年十二月 &(27)
2011年十一月 &(6)
2011年十月 &(11)
2011年九月 &(13)
2011年八月 &(13)
2011年七月 &(19)
2011年六月 &(18)
2011年五月 &(6)
2011年四月 &(12)
2011年三月 &(15)
2011年二月 &(6)
2011年一月 &(9)
2010年十二月 &(6)
2010年十一月 &(11)
2010年十月 &(5)
2010年九月 &(8)
2010年八月 &(5)
2010年七月 &(12)
2010年六月 &(4)
2010年五月 &(7)
2010年四月 &(6)
2010年三月 &(12)
2010年二月 &(7)
2010年一月 &(2)
2009年十二月 &(5)
2009年十一月 &(16)
2009年十月 &(6)
2009年九月 &(7)
2009年八月 &(7)
2009年七月 &(5)
2009年六月 &(6)
2009年五月 &(6)
2009年四月 &(4)
2009年三月 &(7)
2009年二月 &(6)
2009年一月 &(1)
2008年十二月 &(4)
2008年十一月 &(5)
2008年十月 &(1)
2008年八月 &(1)
2008年七月 &(3)
2008年六月 &(3)
2008年五月 &(3)
2008年三月 &(1)
2007年十二月 &(1)
2007年十月 &(1)
2007年八月 &(4)
2007年七月 &(1)1806人阅读
flume(4)
kibana(1)
efk分析nginx日志
nginx 日志格式
2.81.22.87 - - [2016-01-08T15:33:55+08:00] "GET /do_not_delete/noc.gif HTTP/1.1" 200 3166 "-" "ChinaCache" "-" "0.000" "-" "-"
2.81.22.83 - - [2016-01-08T15:33:55+08:00] "GET /do_not_delete/noc.gif HTTP/1.1" 200 3166 "-" "ChinaCache" "-" "0.000" "-" "-"
2.68.137.194 - - [2016-01-08T15:33:55+08:00] "POST /api/user/addXingeDeviceInfo HTTP/1.1" 200 273 "-" "111111" "123.233.132.208" "0.054" "192.168.2.28:31086" "0.054"
2.202.80.20 - - [2016-01-08T15:33:56+08:00] "POST /api/user/getAmount HTTP/1.1" 200 453 "-" "111111" "124.94.99.36" "1.210" "192.168.2.28:31086" "1.210"
2.185.231.55 - - [2016-01-08T15:38:45+08:00] "GET /authCode?pageId=userregister HTTP/1.1" 301 184 "/authCode?pageId=userregister" "Mozilla/4.0 ( MSIE 9.0; Windows NT 6.1)" "-" "0.000" "-" "
nginx 日志配置(时间使用ISO8601格式)
log_format
'$remote_addr - $remote_user [$time_iso8601] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$request_time" "$upstream_addr" "$upstream_response_time"';
nginxFlume.conf
agent.sources = api
agent.channels = mch fch
agent.sinks = elasticSearch
agent.sources.api.type = exec
agent.sources.api.command = tail -F /data/nginx/logs/api.longdai.com.log
agent.sources.api.restart = true
agent.sources.api.logStdErr = true
agent.sources.api.batchSize = 100
agent.sources.api.channels = fch
agent.sources.api.interceptors = cdn sr api i1
agent.sources.api.interceptors.api.type = static
agent.sources.api.interceptors.api.key = app
agent.sources.api.interceptors.api.value = api
agent.sources.api.interceptors.cdn.type = regex_filter
agent.sources.api.interceptors.cdn.regex = .*\\s+\\"ChinaCache\\"\\s+.*
agent.sources.api.interceptors.cdn.excludeEvents = true
agent.sources.api.interceptors.sr.type=search_replace
agent.sources.api.interceptors.sr.searchPattern=\\{
agent.sources.api.interceptors.sr.replaceString=%7b
agent.sources.api.interceptors.sr.charset=UTF-8
agent.sources.api.interceptors.i1.type = regex_extractor
agent.sources.api.interceptors.i1.regex = ([^\\s]*)\\s-\\s([^\\s]*)\\s\\[(.*)\\]\\s+\\"([\\S]*)\\s+([\\S]*)\\s+[\\S]*\\"\\s+(\\d+)\\s+(
\\d+)\\s+\\"([^\\"]*)\\"\\s+\\"([^\\"]*)\\"\\s+\\"([^\\"]*)\\"\\s+\\"([^\\"]*)\\"\\s+\\"([^\\"]*)\\"\\s+\\"([^\\"]*)\\"
agent.sources.api.interceptors.i1.serializers = s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13
agent.sources.api.interceptors.i1.serializers.s1.name = remote_addr
agent.sources.api.interceptors.i1.serializers.s2.name = remote_user
agent.sources.api.interceptors.i1.serializers.s3.name = datetime
#这里的时间已经是ISO8601格式,kibana可以直接识别为时间格式,所以下面的3行可以不用
#agent.sources.api.interceptors.i1.serializers.s3.type = org.apache.flume.interceptor.RegexExtractorInterceptorMillisSerializer
#agent.sources.api.interceptors.i1.serializers.s3.name = timestamp
#agent.sources.api.interceptors.i1.serializers.s3.pattern
= yyyy-MM-dd'T'HH:mm:ssZ
agent.sources.api.interceptors.i1.serializers.s4.name = http_method
agent.sources.api.interceptors.i1.serializers.s5.name = uri
agent.sources.api.interceptors.i1.serializers.s6.name = status
agent.sources.api.interceptors.i1.serializers.s7.name = body_length
agent.sources.api.interceptors.i1.serializers.s8.name = http_referer
agent.sources.api.interceptors.i1.serializers.s9.name = user_agent
agent.sources.api.interceptors.i1.serializers.s10.name = http_x_forwarded_for
agent.sources.api.interceptors.i1.serializers.s11.name = request_time
agent.sources.api.interceptors.i1.serializers.s12.name = upstream_addr
agent.sources.api.interceptors.i1.serializers.s13.name = upstream_response_time
agent.sinks.elasticSearch.type = org.apache.flume.sink.elasticsearch.ElasticSearchSink
agent.sinks.elasticSearch.channel = fch
agent.sinks.elasticSearch.batchSize = 2000
agent.sinks.elasticSearch.hostNames = 192.168.2.25:9300
agent.sinks.elasticSearch.indexName = nginx
agent.sinks.elasticSearch.indexType = nginx
agent.sinks.elasticSearch.clusterName = myES
agent.sinks.elasticSearch.client = transport
agent.sinks.elasticSearch.serializer = org.apache.flume.sink.elasticsearch.ElasticSearchLogStashEventSerializer
# Each sink's type must be defined
agent.sinks.loggerSink.type = logger
#Specify the channel the sink should use
agent.sinks.loggerSink.channel = mch
# Each channel's type is defined.
agent.channels.mch.type = memory
agent.channels.mch.capacity = 2000
agent.channels.mch.transactionCapacity = 2000
agent.channels.mch.byteCapacityBufferPercentage = 20
agent.channels.mch.keep-alive = 30
agent.channels.fch.type = file
agent.channels.fch.checkpointDir = /data/flume/data/checkpointDir
agent.channels.fch.dataDirs = /data/flume/data/dataDirs
elasticSearch 存储的nginx日志
分析日志展示
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:228735次
积分:3574
积分:3574
排名:第9403名
原创:124篇
转载:40篇
评论:32条
(1)(1)(4)(2)(3)(1)(3)(5)(1)(5)(3)(1)(4)(4)(4)(2)(2)(4)(2)(1)(6)(6)(14)(6)(1)(8)(7)(8)(5)(8)(4)(2)(4)(15)(3)(6)(2)(3)(2)(1)Nginx+Logstash+Elasticsearch+Kibana搭建网站日志分析系统笔记 - 为程序员服务
Nginx+Logstash+Elasticsearch+Kibana搭建网站日志分析系统笔记
Nginx+Logstash+Elasticsearch+Kibana搭建网站日志分析系统笔记 前言 流程,n […]
原文地址:, 感谢原作者分享。
您可能感兴趣的代码

我要回帖

更多关于 elasticsearch 的文章

 

随机推荐