Skip to content

Instantly share code, notes, and snippets.

View ph's full-sized avatar
💭
Where is the Microsoft Paperclip?

Pier-Hugues Pellerin ph

💭
Where is the Microsoft Paperclip?
View GitHub Profile
@ph
ph / trevor.go
Created November 24, 2017 02:29
bleh
if err != nil {
fmt.Fprintf(os.Stderr, "Could not read the file, file: %s, error: %v\n", file, err)
os.Exit(1)
}
Paste your code between the ```
```yaml
filebeat.prospectors:
# Each - is a prospector. Most options can be set at the prospector level, so
# you can use different prospectors for various configurations.
# Below are the prospector specific configurations.
- type: log
# encoding: utf-8
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'rack'
gem 'sinatra', :require => 'sinatra/base'
gem 'pry'
end
@ph
ph / compress_requests.rb
Created August 22, 2017 15:10 — forked from relistan/compress_requests.rb
Rack Middleware to automatically unzip gzipped/deflated POST data
class CompressedRequests
def initialize(app)
@app = app
end
def method_handled?(env)
!!(env['REQUEST_METHOD'] =~ /(POST|PUT)/)
end
def encoding_handled?(env)
{
"successful": {
"logstash-codec-cef": {
"version": "4.1.3",
"from": "default"
},
"logstash-codec-collectd": {
"version": "3.0.5",
"from": "default"
},
Execution of label: Fetch all available plugins on `logstash-plugins`, 61.17s
Default installed: 94 Total available plugins: 197
Successfully installed: logstash-filter-cidr
Successfully installed: logstash-filter-elasticsearch
Successfully installed: logstash-filter-translate
Failed to install: logstash-filter-punct
Successfully installed: logstash-input-github
Successfully installed: logstash-filter-anonymize
Successfully installed: logstash-codec-compress_spooler
Failed to install: logstash-codec-oldlogstashjson
Failures:
1) LogStash::Timestamp constructors should work
Failure/Error: expect(t.time).to eq(now)
expected: 2017-05-17 19:08:23.399613000 +0000
got: 2017-05-17 19:08:23.399000000 +0000
(compared using ==)
{
"successful": {
"logstash-core-plugin-api": {
"version": "2.1.16",
"from": "default"
},
"logstash-codec-cef": {
"version": "4.1.2",
"from": "default"
},
# encoding: utf-8
require "logstash/config/source/base"
require "logstash/config/pipeline_config"
require "logstash/util/loggable"
require "logstash/errors"
module LogStash module Config module Source
# Modules could be a weird names?
class Modules < Base
def pipeline_configs
{
"successful": {
"logstash-core-plugin-api": {
"version": "2.1.16",
"from": "default"
},
"logstash-codec-cef": {
"version": "4.1.2",
"from": "default"
},