新聞中心
這篇文章主要講解了“nginx的heka怎么配置”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“nginx的heka怎么配置”吧!
創(chuàng)新互聯(lián)公司是專業(yè)的比如網(wǎng)站建設(shè)公司,比如接單;提供成都網(wǎng)站設(shè)計、做網(wǎng)站,網(wǎng)頁設(shè)計,網(wǎng)站設(shè)計,建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進行比如網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團隊,希望更多企業(yè)前來合作!
負責解析nginx產(chǎn)生的log數(shù)據(jù),分成access,error等不同的日志數(shù)據(jù)格式。這里只例舉出access的日志數(shù)據(jù)。
180.153.206.18 - - [17/Jul/2016:00:00:04 +0800] "GET /static/bootstrap/bsie/js/bootstrap-ie.min.js HTTP/1.1" 200 6276
180.153.206.18 - - [17/Jul/2016:00:00:04 +0800] "GET /static/flash/zoom.min.js HTTP/1.1" 200 2174
180.153.206.18 - - [17/Jul/2016:00:00:04 +0800] "GET /static/My97DatePicker/WdatePicker.js HTTP/1.1" 200 8872
180.153.206.18 - - [17/Jul/2016:00:00:04 +0800] "GET /static/modules/ticket/ticketUtil.js HTTP/1.1" 200 1838
180.153.206.18 - - [17/Jul/2016:00:00:04 +0800] "GET /static/common/jeesite.min.js HTTP/1.1" 200 3672
對應(yīng)的heka配置如下,
[hekad]
maxprocs = 2
[TestWebserver]
type = "LogstreamerInput"
log_directory = "/opt/modules/heka/data/nginx/"
file_match = 'access\.log'
decoder = "CombinedLogDecoder"
[CombinedLogDecoder]
type = "SandboxDecoder"
filename = "lua_decoders/nginx_access.lua"
[CombinedLogDecoder.config]
type = "combined"
user_agent_transform = true
log_format = '$remote_addr - $remote_user [$time_local] "$request" $status$body_bytes_sent'
[RstEncoder]
[LogOutput]
message_matcher = "TRUE"
encoder = "RstEncoder"
注意log_format要和nginx的log格式對應(yīng)上,才不會出錯。
結(jié)果,

感謝各位的閱讀,以上就是“nginx的heka怎么配置”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對nginx的heka怎么配置這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!
網(wǎng)頁名稱:nginx的heka怎么配置
文章出自:http://www.dlmjj.cn/article/jgdpgd.html


咨詢
建站咨詢
