Last active
March 26, 2018 20:06
-
-
Save keremcankabadayi/2d5a4ca43318bfdf226c663d33a91d9a to your computer and use it in GitHub Desktop.
nginx.conf & nginx.pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93.87.248.208 - - [17/Mar/2018:21:05:19 +0300] "GET /wp-admin HTTP/1.1" 200 5015 0.738 0.738 ."-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/5350 (KHTML, like Gecko) Chrome/13.0.829.0 Safari/5350" "-" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path =>"/Users/kerem/Desktop/ElasticStackOrnekCalisanSistemler/NginxLive/logs.log" | |
start_position => "beginning" | |
} | |
} | |
filter { | |
grok { | |
match => { "message" => "%{NGINX}" } | |
} | |
date { | |
match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ] | |
} | |
geoip { | |
source => "clientip" | |
target => "geoip" | |
} | |
useragent { | |
source => "agent" | |
target => "user_agent" | |
} | |
} | |
output { | |
elasticsearch { | |
hosts => ["localhost:9200"] | |
index => "nginxlive" | |
document_type => "logs" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NGINX %{IPORHOST:clientip} - - \[%{HTTPDATE:timestamp}] \"(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|-)\" %{NUMBER:status_code} (?:%{NUMBER:bytes}|-) %{NUMBER:request_time} %{NUMBER:upstream_response_time} %{NOTSPACE:referer} %{QS:agent} %{QS:zipcode} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment