Skip to content

Instantly share code, notes, and snippets.

View devynspencer's full-sized avatar
:octocat:

Devyn Spencer devynspencer

:octocat:
View GitHub Profile
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr']
def human_log(res):
if type(res) == type(dict()):
for field in FIELDS:
if field in res.keys():
encoded_field = res[field].encode('utf-8')
print '\n{0}:\n{1}'.format(field, encoded_field)
@devynspencer
devynspencer / logstash-json.conf
Last active May 10, 2023 15:10 — forked from untergeek/logstash-json.conf
JSON rsyslog output for Logstash
template(name="ls_json" type="list" option.json="on") {
constant(value="{")
constant(value="\"@timestamp\":\"") property(name="timereported" dateFormat="rfc3339")
constant(value="\",\"@version\":\"1")
constant(value="\",\"message\":\"") property(name="msg")
constant(value="\",\"host\":\"") property(name="hostname")
constant(value="\",\"severity\":\"") property(name="syslogseverity-text")
constant(value="\",\"facility\":\"") property(name="syslogfacility-text")
constant(value="\",\"programname\":\"") property(name="programname")
constant(value="\",\"procid\":\"") property(name="procid")
@devynspencer
devynspencer / fs.rb
Created December 4, 2015 19:44 — forked from geewiz/fs.rb
Chef recipe to set noexec option for /dev/shm
# remount /dev/shm
execute "remount_shm" do
action :nothing
command "mount -o remount /dev/shm"
end
# set noexec for /dev/shm
bash "shm_noexec" do
user "root"
cwd "/etc"
@devynspencer
devynspencer / multitailrc.symlink
Last active September 21, 2023 19:37 — forked from homeyjd/.multitailrc
multitail color scheme