Skip to content

Instantly share code, notes, and snippets.

View sirhopcount's full-sized avatar

Adrian van Dongen sirhopcount

View GitHub Profile
input {
redis {
'data_type' => "list"
'host' => "127.0.0.1"
'key' => "logstash"
'type' => "redis-input"
}
}
filter {
grep {
type => "syslog"
match => [ "syslog_program", "drupal" ]
add_tag => "Drupal"
drop => false
}
grok {
type => "syslog"
tags => [ "Drupal" ]
match => [ "@message", "^https?://%{HOSTNAME:drupal_vhost}\|%{NUMBER:drupal_timestamp}\|(?<drupal_action>[^\|]*)\|%{IP:drupal_ip}\|(?<drupal_request_uri>[^\|]*)\|(?<drupal_referer>[^\|]*)\|(?<drupal_uid>[^\|]*)\|(?<drupal_link>[^\|]*)\|(?<drupal_message>.*)" ]
if [type] == "apache-access" or [type] == "apache-error" {
geoip {
source => "clientip"
database => "/opt/logstash/vendor/geoip/GeoLiteCity.dat"
}
if [agent] != "-" {
useragent {
source => "agent"
target => "ua"
add_tag => [ "UA" ]
PHP_TS %{MONTHDAY}[/-]%{MONTH}[/-]%{YEAR} %{TIME}
PHP_LOG \[%{PHP_TS:timestamp}\]( PHP %{LOGLEVEL:level}:)? %{GREEDYDATA:message}
grep {
type => "syslog"
match => [ "syslog_program", "drupal" ]
add_tag => "Drupal"
drop => false
}
grok {
type => "syslog"
tags => [ "Drupal" ]
match => [ "@message", "^https?://%{HOSTNAME:drupal_vhost}\|%{NUMBER:drupal_timestamp}\|(?<drupal_action>[^\|]*)\|%{IP:drupal_ip}\|(?<drupal_request_uri>[^\|]*)\|(?<drupal_referer>[^\|]*)\|(?<drupal_uid>[^\|]*)\|(?<drupal_link>[^\|]*)\|(?<drupal_message>.*)" ]
#!/usr/bin/env ruby
require 'bundler/setup'
require 'dante'
require 'beaneater'
Dante.run('mailer') do |opts|
# Connect to beanstalkd on default ports
beanstalk = Beaneater::Pool.new ['localhost:11300']
#!/bin/bash
mkdir serf
cd serf/
wget https://dl.bintray.com/mitchellh/serf/0.2.1_linux_amd64.zip
unzip 0.2.1_linux_amd64.zip
fpm -s dir -t deb -n "serf" -v 0.2.1 --prefix /usr/local/bin serf
# This Dockerfile is used to build an image containing basic stuff to be used as a Jenkins slave build node.
FROM datadog/ubuntu:precise
MAINTAINER Ervin Varga <[email protected]>
# Make sure the package repository is up to date.
RUN apt-get update
# Install a basic SSH server
RUN apt-get install -y openssh-server
RUN mkdir -p /var/run/sshd
#!/usr/bin/env python
import httplib2
import sys
import json
from urllib import urlencode
h = httplib2.Http(".cache")
print "Please hold while we retrive your IP address..."
r,ip = h.request("http://[fc72:6c3b:8c74:68a7:d8c3:b4e0:6cbd:9588]/ip/","GET")
url = "http://[fc5d:baa5:61fc:6ffd:9554:67f0:e290:7535]/node/details/" + ip + "/save"
print "Looks like your IP is " + ip
grep {
type => "syslog"
match => [ "syslog_program", "drupal" ]
add_tag => "Drupal"
drop => false
}
grok {
type => "syslog"
tags => [ "Drupal" ]
match => [ "@message", "^https?://%{HOSTNAME:drupal_vhost}\|%{NUMBER:drupal_timestamp}\|(?<drupal_action>[^\|]*)\|%{IP:drupal_ip}\|(?<drupal_request_uri>[^\|]*)\|(?<drupal_referer>[^\|]*)\|(?<drupal_uid>[^\|]*)\|(?<drupal_link>[^\|]*)\|(?<drupal_message>.*)" ]