Skip to content

Instantly share code, notes, and snippets.

View roopendra's full-sized avatar

Roopendra Vishwakarma roopendra

View GitHub Profile
@roopendra
roopendra / apache_sizing_2.json
Last active December 1, 2016 05:16
Elasticsearch template to parse apache log.
{
"template": "elk_workshop",
"settings": {
"index.refresh_interval": "30s",
"number_of_shards": 5,
"number_of_replicas": 0
},
"mappings": {
"_default_": {
@roopendra
roopendra / apache_2.conf
Created November 25, 2016 11:37
Logstash conf to parse apache log and remove additional geoip and agent fields.
input {
stdin { }
}
filter {
grok {
match => {
"message" => '%{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "%{WORD:verb} %{DATA:request} HTTP/%{NUMBER:httpversion}" %{NUMBER:response:int} (?:-|%{NUMBER:bytes:int}) %{QS:referrer} %{QS:agent}'
}
}
@roopendra
roopendra / apache_sizing_1.json
Created November 25, 2016 11:33
Elasticsearch Template for apache access log parsing. all string fields are not_analyzed except message and text fields.
{
"template": "elk_workshop",
"settings": {
"index.refresh_interval": "5s",
"index.codec": "best_compression",
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"_default_": {
@roopendra
roopendra / apache_1.conf
Last active November 25, 2016 12:31
Logstash conf to parse apache log with geoip and browser agent fields.
input {
stdin { }
}
filter {
grok {
match => {
"message" => '%{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "%{WORD:verb} %{DATA:request} HTTP/%{NUMBER:httpversion}" %{NUMBER:response:int} (?:-|%{NUMBER:bytes:int}) %{QS:referrer} %{QS:agent}'
}
}