Skip to content

Commit

Permalink
Merge branch 'master' of http://github.com/rdartus/ELK-starter
Browse files Browse the repository at this point in the history
  • Loading branch information
rdartus committed Nov 22, 2016
2 parents af3f943 + 62b95a4 commit 94b8df1
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 20 deletions.
2 changes: 1 addition & 1 deletion config.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cp -f ~/ELK-starter/configs/logstash/logstash-configs.conf /etc/logstash/conf.d
cp -f ~/ELK-starter/configs/logstash/* /etc/logstash/conf.d
cp -i ~/ELK-starter/configs/nginx/my-default /etc/nginx/sites-available/
ln -s /etc/nginx/sites-available/my-default /etc/nginx/sites-enabled/
cp -i ~/ELK-starter/configs/nginx/proxy-kibana /etc/nginx/sites-available/
Expand Down
32 changes: 32 additions & 0 deletions configs/logstash/logstash-nginx-acces.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
input {
file {
path => ["/var/log/nginx/access.log"]
start_position => beginning
ignore_older => 0
}
}
grok {
match => [ "message" , "%{COMBINEDAPACHELOG}+%{GREEDYDATA:extra_fields}"]
overwrite => [ "message" ]
}

mutate {
convert => ["response", "integer"]
convert => ["bytes", "integer"]
convert => ["responsetime", "float"]
}

geoip {
source => "clientip"
target => "geoip"
add_tag => [ "nginx-geoip" ]
}

date {
match => [ "timestamp" , "dd/MMM/YYYY:HH:mm:ss Z" ]
remove_field => [ "timestamp" ]
}

useragent {
source => "agent"
}
22 changes: 22 additions & 0 deletions configs/logstash/logstash-nginx-error.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
input {
file {
path => ["/var/log/nginx/error.log"]
start_position => beginning
ignore_older => 0
}
}
grok {
match => [ "message" , "(?<timestamp>%{YEAR}[./-]%{MONTHNUM}[./-]%{MONTHDAY}[- ]%{TIME}) \[%{LOGLEVEL:severity}\] %{POSINT:pid}#%{NUMBER}: %{GREEDYDATA:errormessage}(?:, client: (?<client>%{IP}|%{HOSTNAME}))(?:, server: %{IPORHOST:server})(?:, request: %{QS:request})?(?:, upstream: \"%{URI:upstream}\")?(?:, host: %{QS:host})?(?:, referrer: \"%{URI:referrer}\")"]
overwrite => [ "message" ]
}

geoip {
source => "client"
target => "geoip"
add_tag => [ "nginx-geoip" ]
}

date {
match => [ "timestamp" , "YYYY/MM/dd HH:mm:ss" ]
remove_field => [ "timestamp" ]
}
6 changes: 5 additions & 1 deletion configs/nginx/my-default
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ server {
index index.html index.htm index.nginx-debian.html;

server_name _;

error_page 404 /custom_404.html;
location = /custom_404.html {
root /usr/share/nginx/html;
internal;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
Expand Down
2 changes: 1 addition & 1 deletion configs/nginx/proxy-kibana
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server {
listen 5601;
listen 5602;

server_name example.com;
auth_basic "Restricted Access";
Expand Down
4 changes: 2 additions & 2 deletions iptables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ $IPT -A OUTPUT -o lo -j ACCEPT

echo "Allowing new and established incoming connections to port 80, 443"

$IPT -A INPUT -p tcp -m multiport --dports 80,443,5601 -j ACCEPT
$IPT -A INPUT -p tcp -m multiport --dports 80,443,5601,5602 -j ACCEPT

$IPT -A OUTPUT -p tcp -m multiport --sports 80,443,5601 -j ACCEPT
$IPT -A OUTPUT -p tcp -m multiport --sports 80,443,5601,5602 -j ACCEPT



Expand Down
14 changes: 7 additions & 7 deletions shop-around/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="shell">
<!-- Header -->
<div id="header">
<h1 id="logo"><a href="#">shoparound</a></h1>
<h1 id="logo"><a href="/">shoparound</a></h1>
<!-- Cart -->
<!-- <div id="cart"> <a href="#" class="cart-link">Your Shopping Cart</a>
<div class="cl">&nbsp;</div>
Expand All @@ -23,11 +23,11 @@ <h1 id="logo"><a href="#">shoparound</a></h1>
<!-- Navigation -->
<div id="navigation">
<ul>
<li><a href="#" class="">Home</a></li>
<li><a href="#/support">Support</a></li>
<li><a href="#/account">My Account</a></li>
<li><a href="#/store">The Store</a></li>
<li><a href="#/contact">Contact</a></li>
<li><a href="/" class="">Home</a></li>
<li><a href="/support">Support</a></li>
<li><a href="/account">My Account</a></li>
<li><a href="/store">The Store</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</div>
<!-- End Navigation -->
Expand Down Expand Up @@ -76,7 +76,7 @@ <h3 class="ico ico4">Donec imperdiet</h3>
<!-- End Side Full -->
<!-- Footer -->
<div id="footer">
<p class="left"> <a href="#">Home</a> <span>|</span> <a href="#">Support</a> <span>|</span> <a href="#">My Account</a> <span>|</span> <a href="#">The Store</a> <span>|</span> <a href="#">Contact</a> </p>
<p class="left"> <a href="/">Home</a> <span>|</span> <a href="#">Support</a> <span>|</span> <a href="#">My Account</a> <span>|</span> <a href="#">The Store</a> <span>|</span> <a href="#">Contact</a> </p>
<p class="right"> &copy; 2010 Shop Around. Design by <a href="http://chocotemplates.com">Chocotemplates.com</a> </p>
</div>
<!-- End Footer -->
Expand Down
16 changes: 8 additions & 8 deletions shop-around/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
<div class="shell">
<!-- Header -->
<div id="header">
<h1 id="logo"><a href="#">shoparound</a></h1>
<h1 id="logo"><a href="/">shoparound</a></h1>
<!-- Cart -->
<div id="cart"> <a href="#" class="cart-link">Your Shopping Cart</a>
<div id="cart"> <a href="/" class="cart-link">Your Shopping Cart</a>
<div class="cl">&nbsp;</div>
<span>Articles: <strong>4</strong></span> &nbsp;&nbsp; <span>Cost: <strong>$250.99</strong></span> </div>
<!-- End Cart -->
<!-- Navigation -->
<div id="navigation">
<ul>
<li><a href="#" class="active">Home</a></li>
<li><a href="#/support">Support</a></li>
<li><a href="#/account">My Account</a></li>
<li><a href="#/store">The Store</a></li>
<li><a href="#/contact">Contact</a></li>
<li><a href="/" class="active">Home</a></li>
<li><a href="/support">Support</a></li>
<li><a href="/account">My Account</a></li>
<li><a href="/store">The Store</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</div>
<!-- End Navigation -->
Expand Down Expand Up @@ -60,8 +60,8 @@ <h1 id="logo"><a href="#">shoparound</a></h1>
<h3>LOREM IPSUM</h3>
<div class="product-desc">
<h4>WOMEN’S</h4>
<p>Lorem ipsum dolor sit<br />
amet</p>
<p>Lorem ipsum dolor sit<br />
<strong class="price">$58.99</strong> </div>
</div>
</li>
Expand Down

0 comments on commit 94b8df1

Please sign in to comment.