Skip to content

Instantly share code, notes, and snippets.

View timothy-spencer's full-sized avatar

Tim Spencer timothy-spencer

  • GSA/login.gov
  • Moscow, ID
View GitHub Profile
@timothy-spencer
timothy-spencer / main.tf
Last active June 19, 2020 01:06
newrelic module
# this file sets up newrelic alerts for metrics
# Once we get tf 0.13.* going, we can get rid of all the count and [0] silliness
variable "slackchannel" {
default = "#test"
}
variable "slackurl" {
default = "XXX"
}
variable "opsgenieapikey" {
@timothy-spencer
timothy-spencer / gist:737065d939d0f8d0b89b322cdc514076
Created June 19, 2020 00:11
newrelic terraform provider debug output
2020-06-18T16:49:11.866-0700 [INFO] plugin.terraform-provider-newrelic_v2.0.0_x4: configuring server automatic mTLS: timestamp=2020-06-18T16:49:11.866-0700
2020-06-18T16:49:11.894-0700 [DEBUG] plugin.terraform-provider-newrelic_v2.0.0_x4: plugin address: address=/var/folders/qw/0mvlsr0n6q3_kdmn8j2tmcjh0000gp/T/plugin764036075 network=unix timestamp=2020-06-18T16:49:11.894-0700
2020-06-18T16:49:13.105-0700 [INFO] plugin.terraform-provider-newrelic_v2.0.0_x4: configuring server automatic mTLS: timestamp=2020-06-18T16:49:13.101-0700
2020-06-18T16:49:13.134-0700 [DEBUG] plugin.terraform-provider-newrelic_v2.0.0_x4: plugin address: network=unix address=/var/folders/qw/0mvlsr0n6q3_kdmn8j2tmcjh0000gp/T/plugin999364628 timestamp=2020-06-18T16:49:13.134-0700
2020-06-18T16:49:15.448-0700 [INFO] plugin.terraform-provider-newrelic_v2.0.0_x4: configuring server automatic mTLS: timestamp=2020-06-18T16:49:15.448-0700
2020-06-18T16:49:15.481-0700 [DEBUG] plugin.terraform-provider-newrelic_v2.0.0_x4: plugin address: addres
#!/usr/bin/env python3
#
# This script pulls down 30 seconds worth of logs from a particular date/time.
# In our dev env, this takes ~40s and creates about 31MB of data.
#
# This script uses the scroll interface to get all the documents:
# https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html
#
import urllib.request
@timothy-spencer
timothy-spencer / escount.sh
Last active August 14, 2018 22:49
make sure old logs still exist
#!/bin/sh
#
# This script is to count all logs before the start of this current day.
# You can use it to verify before and after an upgrade that all the data is still there.
# The count it gives back should be the same, like so:
#
# elasticsearch_master/07ecd66d-7086-4d0d-b431-23f411ab1b85:~# ./escount.sh
# {"count":18939794,"_shards":{"total":20,"successful":20,"skipped":0,"failed":0}}
# elasticsearch_master/07ecd66d-7086-4d0d-b431-23f411ab1b85:~#
# <run the upgrade>