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
goroutine profile: total 47
10 @ 0x402f88c 0x402f97e 0x4006c94 0x400693b 0x48be584 0x405e1c1
# 0x48be583 github.com/elastic/beats/filebeat/channel.CloseOnSignal.func1+0x33 /Users/ph/go/src/github.com/elastic/beats/filebeat/channel/util.go:83
6 @ 0x402f88c 0x402f97e 0x4006c94 0x400697b 0x48be52e 0x405e1c1
# 0x48be52d github.com/elastic/beats/filebeat/channel.SubOutlet.func1+0x9d /Users/ph/go/src/github.com/elastic/beats/filebeat/channel/util.go:26
3 @ 0x402f88c 0x402a80a 0x4029e07 0x4085f7e 0x4085ffd 0x4086d9a 0x417eff2 0x4190c5d 0x432d925 0x40e87fa 0x40e96ac 0x40e9914 0x42b7350 0x42b715b 0x4327b49 0x432ec2c 0x4332a2e 0x405e1c1
# 0x4029e06 internal/poll.runtime_pollWait+0x56 /Users/ph/.gvm/versions/go1.9.4.darwin.amd64/src/runtime/netpoll.go:173
# 0x4085f7d internal/poll.(*pollDesc).wait+0xad /Users/ph/.gvm/versions/go1.9.4.darwin.amd64/src/internal/poll/fd_poll_runtime.go:85
@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