Pen made for CodePen Challenge.
This file contains hidden or 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
when CLIENT_ACCEPTED { | |
set hsl [HSL::open -proto TCP -pool ##DST-POOLNAME##] | |
# log local0. "[IP::client_addr]:[TCP::client_port]: New hsl: $hsl" | |
} | |
when HTTP_REQUEST { | |
HTTP::header insert X-Forwarded-For [IP::client_addr] | |
# Check for POST requests | |
if {[HTTP::method] eq "POST"}{ |
This file contains hidden or 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
#!/bin/sh | |
# | |
# nginx - this script starts and stops the nginx daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# config: /etc/sysconfig/nginx |
This file contains hidden or 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
{ | |
"basics": { | |
"name": "Fernando Sampaio", | |
"label": "Systems Engineer|Devops", | |
"location": { | |
"city": "Sao Paulo", | |
"countryCode": "BR" | |
}, | |
"profiles": [ | |
{ |
This file contains hidden or 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
log_format access_json '{ "@timestamp": "$time_iso8601", ' | |
'"remotehost": "$remote_addr", ' | |
'"@version": "1", ' | |
'"user": "$remote_user", ' | |
'"bytes": "$body_bytes_sent", ' | |
'"duration": "$request_time", ' | |
'"upstream_response_time": "$upstream_response_time", ' | |
'"upstream_cache_status": "$upstream_cache_status", ' | |
'"status": "$status", ' |
This file contains hidden or 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
template '/etc/haproxy/haproxy.cfg' do | |
source 'haproxy.cfg.erb' | |
owner 'root' | |
group 'root' | |
variables({ | |
nodes_site: search(:node, 'role:web-site').sort_by{ |n| n.name }, | |
nodes_cache: search(:node, 'role:web-cache').sort_by{ |n| n.name }, | |
nodes_blog: search(:node, 'role:web-blog').sort_by{ |n| n.name }, | |
nodes_images: search(:node, 'role:web-images').sort_by{ |n| n.name }, | |
nodes_adm: search(:node, 'role:web-adm').sort_by{ |n| n.name }, |
This file contains hidden or 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
if [type] == "php-error" { | |
grok { | |
match => [ "message", "\[%{MONTHDAY:day}-%{MONTH:month}-%{YEAR:year} %{TIME:time} %{WORD:zone}/%{WORD:country}\] PHP %{DATA:level}\: %{GREEDYDATA:error}" ] | |
add_field => { "timestamp" => "%{day}-%{month}-%{year} %{time} %{zone}/%{country}" } | |
add_tag => [ "%{level}" ] | |
remove_field => [ "day", "month", "year", "time", "zone", "country" ] | |
} | |
multiline { | |
pattern => "(Stack trace:)|(^#.+)|(^\"\")|( thrown+)|(^\s)" | |
what => "previous" |
This file contains hidden or 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
log_format access_json '{ "@timestamp": "$time_iso8601", ' | |
'"remotehost": "$remote_addr", ' | |
'"@version": "1", ' | |
'"user": "$remote_user", ' | |
'"bytes": "$body_bytes_sent", ' | |
'"duration": "$request_time", ' | |
'"upstream_response_time": "$upstream_response_time", ' | |
'"status": "$status", ' | |
'"vhost": "$host", ' | |
'"pipelined": "$pipe", ' |
This file contains hidden or 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
curl -XPUT http://HOST:9200/_template/logstash_per_index -d ' | |
{ | |
"template" : "logstash*", | |
"mappings" : { | |
"logs" : { | |
"properties": { | |
"@timestamp":{"type":"date", | |
"format":"dateOptionalTime"}, | |
"@version":{"type":"string"}, | |
"vhost":{"type":"string"}, |
This file contains hidden or 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
LogFormat "{ \ | |
\"@timestamp\": \"%{%Y-%m-%dT%H:%M:%S%z}t\", \ | |
\"@version\": \"1\", \ | |
\"vhost\":[\"%v\"], \ | |
\"remotehost\": \"%h\", \ | |
\"xforwarded\": \"%{X-Forwarded-For}i\", \ | |
\"user\": \"%u\", \ | |
\"duration\": %D, \ | |
\"status\": %>s, \ | |
\"request\": \"%U%q\", \ |