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
---
http_interactions:
- request:
method: get
uri: https://rubygems.org/api/v1/versions/123-this-doesnt-exist.yaml
body:
encoding: US-ASCII
string: ''
headers:
Accept-Encoding:
We couldn’t find that file to show.
Bundle 'bkad/CamelCaseMotion'
Bundle 'briandoll/change-inside-surroundings.vim'
Bundle 'kien/ctrlp.vim'
Bundle 'bling/vim-airline'
Bundle 'mattn/webapi-vim'
Failures:
1) LogStash::Filters::DNS dns reverse lookup, append "{"foo":"199.192.228.250"}" when processed
Failure/Error: Unable to find matching line from backtrace
Insist::Failure:
Expected "carrera.databits.net", but got "carrerra.databits.net"
# ./spec/filters/dns_spec.rb:52:in `(root)'
# ./lib/logstash/runner.rb:61:in `run'
# ./lib/logstash/runner.rb:116:in `run'
# ./lib/logstash/runner.rb:158:in `run'
1) LogStash::Event metadata with set metadata should allow getting
Failure/Error: insist { subject[fieldref] } == value
Insist::Failure:
Expected "bar", but got nil
# ./spec/core/event_spec.rb:352:in `(root)'
# ./lib/logstash/runner.rb:61:in `run'
# ./lib/logstash/runner.rb:116:in `run'
# ./lib/logstash/runner.rb:158:in `run'
2) LogStash::Event metadata with set metadata should be hidden from .to_json
require 'sinatra/base'
class DownloadAllTheThing
def self.process(payload)
end
end
class Portal < Sinatra::Base
run! if app_file == $0
➜ logstash git:(master) ./bin/logstash rspec --order rand --format d spec/inputs/*_spec.rb
Using Accessor#strict_set for specs
Run options: exclude {:redis=>true, :socket=>true, :performance=>true, :elasticsearch=>true, :broken=>true, :export_cypher=>true}
inputs/syslog
should add unique tag when grok parsing fails
inputs/elasticsearch
should retrieve json event from elasticseach
test bundle install --path vendor
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Installing i18n 0.6.9
Installing json 1.8.1
Installing minitest 5.4.3
Installing thread_safe 0.3.4
Installing tzinfo 1.2.2
Installing activesupport 4.1.8
input {
stdin {
type => syslog
}
}
filter {
if [type] == "syslog" {
grok {
match => { "message" => "<%{POSINT:syslog_pri}>%{SYSLOGTIMESTAMP:[@metadata][syslog_timestamp]} %{SYSLOGHOST:[@metadata][syslog_hostname]} %{PROG:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:[@metadata][syslog_message]}" }
@ph
ph / exec.rb
Created December 22, 2014 15:06
module Specinfra::Backend
class Exec < Base
def build_command(cmd)
use_shell = '/bin/sh'
cmd = cmd.shelljoin if cmd.is_a?(Array)
cmd = "#{use_shell.shellescape} -c #{cmd.shellescape}"
path = Specinfra.configuration.path
if path
cmd = %Q{env PATH="#{path}" #{cmd}}