Skip to content

Instantly share code, notes, and snippets.

@anotherjesse
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save anotherjesse/f8af16e40bf864b0d416 to your computer and use it in GitHub Desktop.

Select an option

Save anotherjesse/f8af16e40bf864b0d416 to your computer and use it in GitHub Desktop.
logstash elasticsearch spot instances

install logstash 1.4 / elasticsearch-1.1.0

bin/elasticsearch

logstash web

bin/logstash web

run logstash ingestor

bin/logstash -f s3.conf -vv

input {
s3 {
bucket => "planet-ec2-data"
prefix => "workers/"
region_endpoint => "us-west-2"
credentials => ["XXX", "YYY"]
interval => 600
}
#stdin { }
}
filter {
# UsageType Operation InstanceID MyBidID MyMaxPrice MarketPrice Charge Version
grok {
pattern => "%{TIMESTAMP_ISO8601:timestamp}\s*UTC\s*%{NOTSPACE:UsageType}\s*%{NOTSPACE:Operation}\s*%{NOTSPACE:InstanceID}\s*%{NOTSPACE:MyBidID}\s*%{BASE10NUM:MyMaxPrice} USD\s*%{BASE10NUM:MarketPrice} USD\s*%{BASE10NUM:Charge} USD\s*1"
}
date {
match => [ "timestamp", "yy-MM-dd HH:mm:ss" ]
}
}
output {
elasticsearch { host => localhost }
stdout { codec => rubydebug }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment