Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Apache access Log logstash profile instance 1

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Log format: LogFormat "% {clientip} I% u% t\"% r\ "% > s% b\"% {Referer} I\ "\"% {User-Agent} I\ "\"% {clientip} i.% {cookie} n\ "combined log example: 183.60.150.34-[23/Jun/2017:17:57:52 + 0800]" GET / jump/cps.jsp?projectcode=0085001&cid=A200647189%7c%7c0000&url=http%3a% 2f%2fwww.mangocity.com HTTP/1.1 "302 -" http://myhenan.qq.com/t-7947749-1.htm"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML) Like Gecko) Chrome/47.0.2526.108 Safari/537.36 2345Explorer/8.6.1.15524 "" 183.60.150.34.10.10.130.100.1498211872045986 "logstash configuration file: input {file {type = >" www_access "path = > [" / usr/local/elk/elklog/apachelog/log0/www.mangocity.com-access_log " "/ usr/local/elk/elklog/apachelog/log1/www.mangocity.com-access_log"]} file {type = > "ro_access" path = > ["/ usr/local/elk/elklog/apachelog/log0/ro.mangocity.com-access_log" "/ usr/local/elk/elklog/apachelog/log1/ro.mangocity.com-access_log"]}} filter {grok {match = > {"message" = >'(% {USER:clientip} |% {IPORHOST:clientip} |% {IPORHOST:clientip} % {IPORHOST})% {USER:ident}% {USER:auth}\ [% {HTTPDATE:timestamp}\] "% {WORD:verb}% {DATA:request} HTTP/% {NUMBER:httpversion}"% {NUMBER:response:int} (?:-|% {NUMBER:bytes:int})% {QS:referrer}% {QS:agent}'} date {match = > ["timestamp" "dd/MMM/YYYY:HH:mm:ss Z"] locale = > en} geoip {source = > "clientip"} useragent {source = > "agent" target = > "useragent"}} output {redis {host = > "10.10.45.200" data_type = > "list" key = > "elk_frontend_access:redis" Port= > "5379"}}

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report