Skip to content

Instantly share code, notes, and snippets.

View sargeant's full-sized avatar

Sam Sargeant sargeant

  • New Zealand
View GitHub Profile
@metmajer
metmajer / README.md
Created February 26, 2015 15:10
Ansible Logging To Elasticsearch

Ansible Logging To Elasticsearch

Turns Ansible log outputs into plain JSON strings and sends them to an Elasticsearch cluster.

Place the script in your playbook's plugins/callbacks/ directory.

# how to migrate your Pocket reading list to Instapaper on the command line, by request from @rmi
# how to avoid getting blocked for exceeding the Instapaper API rate limit is left as an exercise for the reader
#
# yes, of course this is completely ridiculous
$ curl "https://readitlaterlist.com/v2/get?username=name&password=123&apikey=yourapikey" | \
jq '.list[].url' | \
tr -d \" | \
xargs -I %% curl "https://www.instapaper.com/api/add" -G --data "username=name" --data "pass=1234" --data-urlencode "url=%%"
@jordansissel
jordansissel / RESULTS.md
Created September 21, 2012 07:41
screenshot + code showing how to query logstash/elasticsearch with a graphite function.

logstash queries graphed with graphite.

Operation: Decouple whisper from graphite.

Method: Create a graphite function that does a date histogram facet query against elasticsearch for a given query string for the time period viewed in the current graph.

Reason: graphite has some awesome math functions. Wouldn't it be cool if we could use those on logstash results?

The screenshot below is using logstash to watch the twitter stream of keywords "iphone" "apple" and "samsung" - then I graph them each, so we get an idea of popularity. As a bonus, I also do a movingAverage() on the iphone curve to show you why this is awesome.