Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

<section>
<section>
<h1>PostGIS</h1>
<h2>in the Open Cloud</h2>
<p>writing portable open source mapping applications</p>
<p>with</p>
<h2>Leaflet</h2>
<p>and</p>
<h2>OpenShift</h2>
<br/>
\[(?<time>(?:(?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)))))\] (?:Warning:\s*(?<nagios_message>.*)|(?<nagios_type>CURRENT SERVICE STATE): (?<nagios_hostname>.*?);(?<nagios_service>.*?);(?<nagios_state>.*?);(?<nagios_statetype>.*?);(?<nagios_statecode>.*?);(?<nagios_message>.*)|(?<nagios_type>CURRENT HOST STATE): (?<nagios_hostname>.*?);(?<nagios_state>.*?);(?<nagios_statetype>.*?);(?<nagios_statecode>.*?);(?<nagios_message>.*)|(?<nagios_type>SERVICE NOTIFICATION): (?<nagios_notifyname>.*?);(?<nagios_hostname>.*?);(?<nagios_service>.*?);(?<nagios_state>.*?);(?<nagios_contact>.*?);(?<nagios_message>.*)|HOST NOTIFICATION: (?<nagios_notifyname>.*?);(?<nagios_hostname>.*?);(?<nagios_state>.*?);(?<nagios_contact>.*?);(?<nagios_message>.*)|(?<nagios_type>SERVICE ALERT): (?<nagios_hostname>.*?);(?<nagios_service>.*?);(?<nagios_state>.*?);(?<nagios_statelevel>.*?);(?<nagios_attempt>(?:(?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)))));(?<nagios_message>.*)|(?<nagios_type>HOST ALERT): (?<
@kiyoto
kiyoto / default.json
Created July 17, 2014 19:49
EFK Kibana Starter Dashboard
{
"title": "EFK Starter Dashboard",
"services": {
"query": {
"list": {
"0": {
"query": "severity=info",
"alias": "",
"color": "#7EB26D",
"id": 0,
@kiyoto
kiyoto / fluent.conf
Last active August 29, 2015 14:04
hsinclar-test.conf
# sender td-agent.conf
#---------------------------------------------------
<source>
type forward
</source>
<match apache.*>
type secure_forward
shared_key somekey
@kiyoto
kiyoto / update_flume_plugin.markdown
Last active August 29, 2015 14:08
Going about updateing fluent-plugin-flume

This is a little note about how I would go about updating fluent-plugin-flume to resolve this issue.

Cause

The current fluent-plugin-flume supports 0.9 protocol. However, most curernt deployments are on the 1.5 branch. This causes a compatibility issue because the Thrift definition for Flume changed between 0.9 and 1.5.

How to fix it

  1. We need to update the flume.thrift file. The Thrift file definition for Flume 1.5 can be found here.
  2. The actual Thrift server code in Ruby should be generated using Thrift compiler. The 0.9.1 release should work. Use the updated flume.thrift to generate the server code (in lib/fluent/plugin/thrift)
require 'nokogiri'
require 'open-uri'
require 'json'
BASE_URL = 'http://www.tomtunguz.com'
class URLFormatError < RuntimeError; end
def fetch_categories(base_url)
html = open(base_url).read
@kiyoto
kiyoto / fluentd-docs-versioning.markdown
Last active August 29, 2015 14:10
Versioning Fluentd's Documentation

Versioning Fluentd's Documentation

As Fluentd starts rolling out new major uprates (v0.12 & v0.14) and inches towards the v1 release, I want to re-organize and version the docs website

Here is my plan.

  1. All current URLs will start pointing to the latest release. This does NOT include preview releases.
  2. For each page, the version information is embedded as follows: https://docs.fluentd.org/<LANGUAGE>/<VERSION>/<PAGE_NAME>. Ex. https://docs.fluentd.org/ja/v0-12/config-file. The pages that have version info in the URL are called Versioned Pages.
  3. For each Versioned Page that is not the latest version, the following warning shows up on the page:
@kiyoto
kiyoto / file0.txt
Last active August 29, 2015 14:10
DevNullParserで始めるFluentd パーサプラグイン入門 ref: http://qiita.com/kiyoto/items/9903718147adde4d6c32
<source>
type tail
format json
path /path/to/file
tag aoi.yu
</source>
module Fluent
class IfFilter < Filter
Fluent::Plugin.register_filter('if', self)
config_param :if, :string
def configure(conf)
super
@placeholder_expander = RubyPlaceholderExpander.new(log)

With this config, if your hostname is koala and if you have files like

log/t1.log
   /t2.log
   /...

They are sent to